mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-19 04:00:01 +01:00
Merge bitcoin/bitcoin#33728: test: Add bitcoin-chainstate test for assumeutxo functionality
7b5d256af4test: Add bitcoin-chainstate test for assumeutxo functionality (stringintech)2bc3265649Fix `ChainstateManager::AddChainstate()` assertion crash (stringintech)5f3d6bdb66Add regtest support to bitcoin-chainstate tool (stringintech) Pull request description: This PR adds functional test coverage for the bitcoin-chainstate tool loading a datadir initialized with an assumeutxo snapshot. The PR also includes: - Fix for assertion crash in `ChainstateManager::AddChainstate()` when `prev_chainstate` has no initialized mempool (required for the test to pass) - `-regtest` flag support for bitcoin-chainstate to enable the testing This work started while experimenting with the bitcoin-chainstate tool and how the kernel API (#30595) behaved when loading a datadir containing assumeutxo data, during the time that PR was still under review. sedited suggested opening a PR to add this test coverage. ACKs for top commit: achow101: ACK7b5d256af4theStack: Concept and code-review ACK7b5d256af4sedited: Re-ACK7b5d256af4Tree-SHA512: 5d3b0050cf2d53144b5f65451c991d5e212117b4541ae1368ecf58fde5f3cca4f018aad6ae32257b9ebb1c28b926424fbcff496ba5487cdc4eb456cea6db8b24
This commit is contained in:
@@ -6226,7 +6226,7 @@ Chainstate& ChainstateManager::AddChainstate(std::unique_ptr<Chainstate> chainst
|
||||
|
||||
// Transfer possession of the mempool to the chainstate.
|
||||
// Mempool is empty at this point because we're still in IBD.
|
||||
assert(prev_chainstate.m_mempool->size() == 0);
|
||||
assert(!prev_chainstate.m_mempool || prev_chainstate.m_mempool->size() == 0);
|
||||
assert(!curr_chainstate.m_mempool);
|
||||
std::swap(curr_chainstate.m_mempool, prev_chainstate.m_mempool);
|
||||
return curr_chainstate;
|
||||
|
||||
Reference in New Issue
Block a user