mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-02 17:06:00 +00:00
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:
@@ -413,7 +413,12 @@ bool Pathfinder::findPaths(const unsigned int iMaxSteps, const unsigned int iMax
|
|||||||
RippleState* rspEntry = (RippleState*) item.get();
|
RippleState* rspEntry = (RippleState*) item.get();
|
||||||
const uint160& uPeerID = rspEntry->getAccountIDPeer();
|
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.
|
// Peer is in path already. Ignore it to avoid a loop.
|
||||||
cLog(lsTRACE) <<
|
cLog(lsTRACE) <<
|
||||||
|
|||||||
Reference in New Issue
Block a user