mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Don't allow a transaction to spend into the greater of the fee or the reserve.
This commit is contained in:
@@ -220,7 +220,7 @@ TER PaymentTransactor::doApply ()
|
||||
const uint64 uReserve = mEngine->getLedger ()->getReserve (uOwnerCount);
|
||||
|
||||
// Make sure have enough reserve to send. Allow final spend to use reserve for fee.
|
||||
if (mPriorBalance < saDstAmount + uReserve) // Reserve is not scaled by fee.
|
||||
if (mPriorBalance < saDstAmount + std::max(uReserve, mTxn.getTransactionFee ().getNValue ()))
|
||||
{
|
||||
// Vote no. However, transaction might succeed, if applied in a different order.
|
||||
WriteLog (lsINFO, PaymentTransactor) << "";
|
||||
|
||||
Reference in New Issue
Block a user