diff --git a/src/test/mempool_tests.cpp b/src/test/mempool_tests.cpp --- a/src/test/mempool_tests.cpp +++ b/src/test/mempool_tests.cpp @@ -56,8 +56,6 @@ Amount maxFees = Amount::zero(); uint64_t minSize = std::numeric_limits::max(); uint64_t maxSize = 0; - uint64_t minBillableSize = std::numeric_limits::max(); - uint64_t maxBillableSize = 0; // Consume random inputs, but make sure we don't consume more than // available for (size_t input = std::min(InsecureRandRange(maxOutputs) + 1, @@ -82,9 +80,6 @@ maxFees += parent.GetModFeesWithAncestors(); minSize = std::min(minSize, parent.GetSizeWithAncestors()); maxSize += parent.GetSizeWithAncestors(); - minBillableSize = std::min(minBillableSize, - parent.GetBillableSizeWithAncestors()); - maxBillableSize += parent.GetBillableSizeWithAncestors(); } // Produce random number of outputs @@ -112,8 +107,6 @@ maxFees += randFee; minSize += CTransaction(tx).GetTotalSize(); maxSize += CTransaction(tx).GetTotalSize(); - minBillableSize += CTransaction(tx).GetBillableSize(); - maxBillableSize += CTransaction(tx).GetBillableSize(); // Calculate overall values totalFee += randFee; @@ -129,11 +122,6 @@ BOOST_CHECK(latestEntry.GetSizeWithAncestors() >= minSize); BOOST_CHECK(latestEntry.GetSizeWithAncestors() <= maxSize); - BOOST_CHECK(latestEntry.GetBillableSizeWithAncestors() >= - minBillableSize); - BOOST_CHECK(latestEntry.GetBillableSizeWithAncestors() <= - maxBillableSize); - BOOST_CHECK(latestEntry.GetModFeesWithAncestors() >= minFees); BOOST_CHECK(latestEntry.GetModFeesWithAncestors() <= maxFees); diff --git a/src/txmempool.h b/src/txmempool.h --- a/src/txmempool.h +++ b/src/txmempool.h @@ -127,7 +127,6 @@ // Analogous statistics for ancestor transactions uint64_t nCountWithAncestors; uint64_t nSizeWithAncestors; - uint64_t nBillableSizeWithAncestors; Amount nModFeesWithAncestors; int64_t nSigOpCountWithAncestors; @@ -159,9 +158,8 @@ void UpdateDescendantState(int64_t modifySize, int64_t modifyBillableSize, Amount modifyFee, int64_t modifyCount); // Adjusts the ancestor state - void UpdateAncestorState(int64_t modifySize, int64_t modifyBillableSize, - Amount modifyFee, int64_t modifyCount, - int modifySigOps); + void UpdateAncestorState(int64_t modifySize, Amount modifyFee, + int64_t modifyCount, int modifySigOps); // Updates the fee delta used for mining priority score, and the // modified fees with descendants. void UpdateFeeDelta(Amount feeDelta); @@ -179,9 +177,6 @@ uint64_t GetCountWithAncestors() const { return nCountWithAncestors; } uint64_t GetSizeWithAncestors() const { return nSizeWithAncestors; } - uint64_t GetBillableSizeWithAncestors() const { - return nBillableSizeWithAncestors; - } Amount GetModFeesWithAncestors() const { return nModFeesWithAncestors; } int64_t GetSigOpCountWithAncestors() const { return nSigOpCountWithAncestors; @@ -211,21 +206,18 @@ }; struct update_ancestor_state { - update_ancestor_state(int64_t _modifySize, int64_t _modifyBillableSize, - Amount _modifyFee, int64_t _modifyCount, - int64_t _modifySigOpsCost) - : modifySize(_modifySize), modifyBillableSize(_modifyBillableSize), - modifyFee(_modifyFee), modifyCount(_modifyCount), - modifySigOpsCost(_modifySigOpsCost) {} + update_ancestor_state(int64_t _modifySize, Amount _modifyFee, + int64_t _modifyCount, int64_t _modifySigOpsCost) + : modifySize(_modifySize), modifyFee(_modifyFee), + modifyCount(_modifyCount), modifySigOpsCost(_modifySigOpsCost) {} void operator()(CTxMemPoolEntry &e) { - e.UpdateAncestorState(modifySize, modifyBillableSize, modifyFee, - modifyCount, modifySigOpsCost); + e.UpdateAncestorState(modifySize, modifyFee, modifyCount, + modifySigOpsCost); } private: int64_t modifySize; - int64_t modifyBillableSize; Amount modifyFee; int64_t modifyCount; int64_t modifySigOpsCost; diff --git a/src/txmempool.cpp b/src/txmempool.cpp --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -51,7 +51,6 @@ nCountWithAncestors = 1; nSizeWithAncestors = GetTxSize(); - nBillableSizeWithAncestors = GetTxBillableSize(); nModFeesWithAncestors = nFee; nSigOpCountWithAncestors = sigOpCount; } @@ -122,7 +121,6 @@ // Update ancestor state for each descendant mapTx.modify(cit, update_ancestor_state(updateIt->GetTxSize(), - updateIt->GetTxBillableSize(), updateIt->GetModifiedFee(), 1, updateIt->GetSigOpCount())); } @@ -290,18 +288,15 @@ const setEntries &setAncestors) { int64_t updateCount = setAncestors.size(); int64_t updateSize = 0; - int64_t updateBillableSize = 0; int64_t updateSigOpsCount = 0; Amount updateFee = Amount::zero(); for (txiter ancestorIt : setAncestors) { updateSize += ancestorIt->GetTxSize(); - updateBillableSize += ancestorIt->GetTxBillableSize(); updateFee += ancestorIt->GetModifiedFee(); updateSigOpsCount += ancestorIt->GetSigOpCount(); } - mapTx.modify(it, update_ancestor_state(updateSize, updateBillableSize, - updateFee, updateCount, + mapTx.modify(it, update_ancestor_state(updateSize, updateFee, updateCount, updateSigOpsCount)); } @@ -328,14 +323,11 @@ CalculateDescendants(removeIt, setDescendants); setDescendants.erase(removeIt); // don't update state for self int64_t modifySize = -int64_t(removeIt->GetTxSize()); - int64_t modifyBillableSize = - -int64_t(removeIt->GetTxBillableSize()); Amount modifyFee = -1 * removeIt->GetModifiedFee(); int modifySigOps = -removeIt->GetSigOpCount(); for (txiter dit : setDescendants) { - mapTx.modify( - dit, update_ancestor_state(modifySize, modifyBillableSize, - modifyFee, -1, modifySigOps)); + mapTx.modify(dit, update_ancestor_state(modifySize, modifyFee, + -1, modifySigOps)); } } } @@ -388,14 +380,11 @@ assert(int64_t(nCountWithDescendants) > 0); } -void CTxMemPoolEntry::UpdateAncestorState(int64_t modifySize, - int64_t modifyBillableSize, - Amount modifyFee, int64_t modifyCount, +void CTxMemPoolEntry::UpdateAncestorState(int64_t modifySize, Amount modifyFee, + int64_t modifyCount, int modifySigOps) { nSizeWithAncestors += modifySize; assert(int64_t(nSizeWithAncestors) > 0); - nBillableSizeWithAncestors += modifyBillableSize; - assert(int64_t(nBillableSizeWithAncestors) >= 0); nModFeesWithAncestors += modifyFee; nCountWithAncestors += modifyCount; assert(int64_t(nCountWithAncestors) > 0); @@ -991,7 +980,7 @@ setDescendants.erase(it); for (txiter descendantIt : setDescendants) { mapTx.modify(descendantIt, - update_ancestor_state(0, 0, nFeeDelta, 0, 0)); + update_ancestor_state(0, nFeeDelta, 0, 0)); } } }