From 2c7a846c3e78f03066c8ed39fa1ac73d127a28d4 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Thu, 26 Sep 2013 15:50:46 -0700 Subject: [PATCH] Don't allow a transaction to spend into the greater of the fee or the reserve. --- src/ripple_app/tx/PaymentTransactor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ripple_app/tx/PaymentTransactor.cpp b/src/ripple_app/tx/PaymentTransactor.cpp index 95ec1013b..80e45777f 100644 --- a/src/ripple_app/tx/PaymentTransactor.cpp +++ b/src/ripple_app/tx/PaymentTransactor.cpp @@ -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) << "";