Sanity check GetFeerateDiagram() in CTxMemPool::check()
This commit is contained in:
1 parent
de2e9a24c4
commit
315e43e5d8
1 file changed
+7
-1
+7
-1
@@ -425,9 +425,15 @@ void CTxMemPool::check(const CCoinsViewCache& active_coins_tip, int64_t spendhei
|
|||||||
|
|
||||||
CCoinsViewCache mempoolDuplicate(const_cast<CCoinsViewCache*>(&active_coins_tip));
|
CCoinsViewCache mempoolDuplicate(const_cast<CCoinsViewCache*>(&active_coins_tip));
|
||||||
|
|
||||||
|
const auto score_with_topo{GetSortedScoreWithTopology()};
|
||||||
|
|
||||||
|
// Number of chunks is bounded by number of transactions.
|
||||||
|
const auto diagram{GetFeerateDiagram()};
|
||||||
|
Assume(diagram.size() <= score_with_topo.size() + 1);
|
||||||
|
|
||||||
std::optional<Wtxid> last_wtxid = std::nullopt;
|
std::optional<Wtxid> last_wtxid = std::nullopt;
|
||||||
|
|
||||||
for (const auto& it : GetSortedScoreWithTopology()) {
|
for (const auto& it : score_with_topo) {
|
||||||
checkTotal += it->GetTxSize();
|
checkTotal += it->GetTxSize();
|
||||||
check_total_fee += it->GetFee();
|
check_total_fee += it->GetFee();
|
||||||
innerUsage += it->DynamicMemoryUsage();
|
innerUsage += it->DynamicMemoryUsage();
|
||||||
|
|||||||
Reference in new issue
Block a user