diff --git a/src/ripple/app/book/impl/Taker.cpp b/src/ripple/app/book/impl/Taker.cpp index 580d93f005..797db5ebb7 100644 --- a/src/ripple/app/book/impl/Taker.cpp +++ b/src/ripple/app/book/impl/Taker.cpp @@ -490,6 +490,10 @@ TER Taker::transfer_xrp ( if (from == to) return tesSUCCESS; + // Transferring zero is equivalent to not doing a transfer + if (amount == zero) + return tesSUCCESS; + return m_view.transfer_xrp (from, to, amount); } @@ -504,6 +508,12 @@ TER Taker::redeem_iou ( if (account == issue.account) return tesSUCCESS; + // Transferring zero is equivalent to not doing a transfer + if (amount == zero) + return tesSUCCESS; + + // If we are trying to redeem some amount, then the account + // must have a credit balance. if (get_funds (account, amount) <= zero) throw std::logic_error ("redeem_iou has no funds to redeem"); @@ -526,6 +536,10 @@ TER Taker::issue_iou ( if (account == issue.account) return tesSUCCESS; + // Transferring zero is equivalent to not doing a transfer + if (amount == zero) + return tesSUCCESS; + return m_view.issue_iou (account, amount, issue); }