mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-29 07:25:51 +00:00
Don't let people send more XRP than they have.
This commit is contained in:
@@ -1383,8 +1383,15 @@ TER LedgerEntrySet::accountSend(const uint160& uSenderID, const uint160& uReceiv
|
||||
|
||||
if (sleSender)
|
||||
{
|
||||
sleSender->setFieldAmount(sfBalance, sleSender->getFieldAmount(sfBalance) - saAmount);
|
||||
entryModify(sleSender);
|
||||
if (sleSender->getFieldAmount(sfBalance) < saAmount)
|
||||
{
|
||||
terResult = isSetBit(mParams, tapOPEN_LEDGER) ? telFAILED_PROCESSING : tecFAILED_PROCESSING;
|
||||
}
|
||||
else
|
||||
{
|
||||
sleSender->setFieldAmount(sfBalance, sleSender->getFieldAmount(sfBalance) - saAmount);
|
||||
entryModify(sleSender);
|
||||
}
|
||||
}
|
||||
|
||||
if (sleReceiver)
|
||||
|
||||
@@ -2322,7 +2322,7 @@ TER RippleCalc::calcNodeAccountFwd(
|
||||
saCurDeliverAct = std::min(saCurDeliverAct, psCur.saInReq-psCur.saInAct);
|
||||
|
||||
// Limit XRP by available. No limit for non-XRP as issuer.
|
||||
if (!uCurAccountID)
|
||||
if (!uCurrencyID)
|
||||
saCurDeliverAct = std::min(saCurDeliverAct, lesActive.accountHolds(uCurAccountID, CURRENCY_XRP, ACCOUNT_XRP));
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user