From ec0481a42d8b3bfca8c5c3cd68b5499aeb9b1c07 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Sun, 7 Jul 2013 17:43:02 -0700 Subject: [PATCH] Don't assert if a payment chains two offers from the same offeror. --- src/cpp/ripple/ripple_LedgerEntrySet.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cpp/ripple/ripple_LedgerEntrySet.cpp b/src/cpp/ripple/ripple_LedgerEntrySet.cpp index d80d72bd42..29fb941fa8 100644 --- a/src/cpp/ripple/ripple_LedgerEntrySet.cpp +++ b/src/cpp/ripple/ripple_LedgerEntrySet.cpp @@ -1577,7 +1577,9 @@ TER LedgerEntrySet::accountSend (const uint160& uSenderID, const uint160& uRecei { TER terResult = tesSUCCESS; - if (!saAmount) + assert (!saAmount.isNegative ()); + + if (!saAmount || (uSenderID == uReceiverID)) { nothing (); } @@ -1598,8 +1600,6 @@ TER LedgerEntrySet::accountSend (const uint160& uSenderID, const uint160& uRecei % (sleReceiver ? (sleReceiver->getFieldAmount (sfBalance)).getFullText () : "-") % saAmount.getFullText ()); - assert (!saAmount.isNegative ()); - if (sleSender) { if (sleSender->getFieldAmount (sfBalance) < saAmount) @@ -1635,7 +1635,6 @@ TER LedgerEntrySet::accountSend (const uint160& uSenderID, const uint160& uRecei % RippleAddress::createHumanAccountID (uReceiverID) % saAmount.getFullText ()); - assert (!saAmount.isNegative ()); terResult = rippleSend (uSenderID, uReceiverID, saAmount, saActual); }