mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-18 18:15:50 +00:00
Expedite zero flow handling
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user