Fix a bug where we negate the balance during pathfinding.

This commit is contained in:
JoelKatz
2013-03-05 15:17:37 -08:00
parent 791b088ff3
commit 3f6cb78158
3 changed files with 9 additions and 9 deletions

View File

@@ -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());