Fix a major pathfinding bug. This improves pathfinding performance by a

factor of three, fixes many invalid paths and fixes redundant paths.
This commit is contained in:
JoelKatz
2013-03-06 03:58:13 -08:00
parent aa2503081e
commit ecf0a9e894

View File

@@ -413,7 +413,12 @@ bool Pathfinder::findPaths(const unsigned int iMaxSteps, const unsigned int iMax
RippleState* rspEntry = (RippleState*) item.get();
const uint160& uPeerID = rspEntry->getAccountIDPeer();
if (spPath.hasSeen(uPeerID, speEnd.mCurrencyID, uPeerID))
if (speEnd.mCurrencyID != rspEntry->getLimit().getCurrency())
{
// wrong currency
nothing();
}
else if (spPath.hasSeen(uPeerID, speEnd.mCurrencyID, uPeerID))
{
// Peer is in path already. Ignore it to avoid a loop.
cLog(lsTRACE) <<