mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-10 09:06:15 +01:00
Fix bug in p2p_headers_presync harness
This commit is contained in:
parent
e13da501db
commit
a7498cc7e2
1 changed files with 8 additions and 8 deletions
|
@ -197,6 +197,7 @@ FUZZ_TARGET(p2p_headers_presync, .init = initialize)
|
||||||
auto headers_msg = NetMsg::Make(NetMsgType::BLOCK, TX_WITH_WITNESS(block));
|
auto headers_msg = NetMsg::Make(NetMsgType::BLOCK, TX_WITH_WITNESS(block));
|
||||||
g_testing_setup->SendMessage(fuzzed_data_provider, std::move(headers_msg));
|
g_testing_setup->SendMessage(fuzzed_data_provider, std::move(headers_msg));
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// This is a conservative overestimate, as base is only moved forward when sending headers. In theory,
|
// This is a conservative overestimate, as base is only moved forward when sending headers. In theory,
|
||||||
// the longest chain generated by this test is 1600 (FUZZ_MAX_HEADERS_RESULTS * 100) headers. In that case,
|
// the longest chain generated by this test is 1600 (FUZZ_MAX_HEADERS_RESULTS * 100) headers. In that case,
|
||||||
|
@ -205,7 +206,6 @@ FUZZ_TARGET(p2p_headers_presync, .init = initialize)
|
||||||
|
|
||||||
// This test should never create a chain with more work than MinimumChainWork.
|
// This test should never create a chain with more work than MinimumChainWork.
|
||||||
assert(total_work < chainman.MinimumChainWork());
|
assert(total_work < chainman.MinimumChainWork());
|
||||||
}
|
|
||||||
|
|
||||||
// The headers/blocks sent in this test should never be stored, as the chains don't have the work required
|
// The headers/blocks sent in this test should never be stored, as the chains don't have the work required
|
||||||
// to meet the anti-DoS work threshold. So, if at any point the block index grew in size, then there's a bug
|
// to meet the anti-DoS work threshold. So, if at any point the block index grew in size, then there's a bug
|
||||||
|
|
Loading…
Add table
Reference in a new issue