mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Fix a bug where we negate the balance during pathfinding.
This commit is contained in:
@@ -424,7 +424,7 @@ bool Pathfinder::findPaths(const unsigned int iMaxSteps, const unsigned int iMax
|
||||
}
|
||||
else if (!rspEntry->getBalance().isPositive() // No IOUs to send.
|
||||
&& (!rspEntry->getLimitPeer() // Peer does not extend credit.
|
||||
|| *rspEntry->getBalance().negate() >= rspEntry->getLimitPeer() // No credit left.
|
||||
|| -rspEntry->getBalance() >= rspEntry->getLimitPeer() // No credit left.
|
||||
|| (bRequireAuth && !rspEntry->getAuth()))) // Not authorized to hold credit.
|
||||
{
|
||||
// Path has no credit left. Ignore it.
|
||||
@@ -700,7 +700,7 @@ boost::unordered_set<uint160> usAccountSourceCurrencies(const RippleAddress& raA
|
||||
// Filter out non
|
||||
if (saBalance.isPositive() // Have IOUs to send.
|
||||
|| (rspEntry->getLimitPeer() // Peer extends credit.
|
||||
&& *saBalance.negate() < rspEntry->getLimitPeer())) // Credit left.
|
||||
&& -saBalance < rspEntry->getLimitPeer())) // Credit left.
|
||||
{
|
||||
// Path has no credit left. Ignore it.
|
||||
usCurrencies.insert(saBalance.getCurrency());
|
||||
|
||||
Reference in New Issue
Block a user