aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorglozow <gloriajzhao@gmail.com>2024-07-09 14:06:30 +0100
committerglozow <gloriajzhao@gmail.com>2024-07-09 17:22:57 +0100
commit09370529fb9f6d06f6d16bdb1fb336f7a265d8ba (patch)
treeeadd58a71267d2724bb0532bcc2759b3b9ecc922
parentde273d53004f48e4c8c965f7ce0bd375fd8d0d69 (diff)
fuzz: mini_miner_selection fixups.
Delete asserts that are redundant with the == assert. Add assertion that the coinbase isn't already in mock_template_txids.
-rw-r--r--src/test/fuzz/mini_miner.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/test/fuzz/mini_miner.cpp b/src/test/fuzz/mini_miner.cpp
index 3a1663364f..51de4d0166 100644
--- a/src/test/fuzz/mini_miner.cpp
+++ b/src/test/fuzz/mini_miner.cpp
@@ -188,9 +188,9 @@ FUZZ_TARGET(mini_miner_selection, .init = initialize_miner)
auto mock_template_txids = mini_miner.GetMockTemplateTxids();
// MiniMiner doesn't add a coinbase tx.
assert(mock_template_txids.count(blocktemplate->block.vtx[0]->GetHash()) == 0);
- mock_template_txids.emplace(blocktemplate->block.vtx[0]->GetHash());
- assert(mock_template_txids.size() <= blocktemplate->block.vtx.size());
- assert(mock_template_txids.size() >= blocktemplate->block.vtx.size());
+ auto [iter, new_entry] = mock_template_txids.emplace(blocktemplate->block.vtx[0]->GetHash());
+ assert(new_entry);
+
assert(mock_template_txids.size() == blocktemplate->block.vtx.size());
for (const auto& tx : blocktemplate->block.vtx) {
assert(mock_template_txids.count(tx->GetHash()));