From 02bdc9d6575e1464e08a37bf57fe79daaefcb9b0 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Tue, 22 Oct 2019 18:14:35 -0700 Subject: [PATCH] Fix mempool bug where fees are mis-calculated when fSkipExpiry is used --- src/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 17980ec1f..38bba3d26 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1950,17 +1950,18 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa } CAmount nValueOut = tx.GetValueOut(); - CAmount nFees = nValueIn-nValueOut; - double dPriority = 0; + double dPriority = 0; + CAmount nFees = 0; + if (!fSkipExpiry) { dPriority = view.GetPriority(tx, chainActive.Height()); - nFees = 0; + nFees = nValueIn-nValueOut; } if ( nValueOut > 777777*COIN && KOMODO_VALUETOOBIG(nValueOut - 777777*COIN) != 0 ) // some room for blockreward and txfees return state.DoS(100, error("AcceptToMemoryPool: GetValueOut too big"),REJECT_INVALID,"tx valueout is too big"); - + // Keep track of transactions that spend a coinbase, which we re-scan // during reorgs to ensure COINBASE_MATURITY is still met. bool fSpendsCoinbase = false; @@ -1973,7 +1974,6 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa } } } -//fprintf(stderr,"addmempool 5\n"); // Grab the branch ID we expect this transaction to commit to. We don't // yet know if it does, but if the entry gets added to the mempool, then