mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-15 18:10:26 +01:00
coins: don't mutate main cache when connecting block
Use `CoinsViewOverlay` when connecting blocks in `ConnectTip`. Add a new integration test to verify that using CoinsViewOverlay does not mutate the main cache during validation for an invalid block. Co-authored-by: l0rinc <pap.lorinc@gmail.com>
This commit is contained in:
@@ -1856,7 +1856,7 @@ void CoinsViews::InitCache()
|
||||
{
|
||||
AssertLockHeld(::cs_main);
|
||||
m_cacheview = std::make_unique<CCoinsViewCache>(&m_catcherview);
|
||||
m_connect_block_view = std::make_unique<CCoinsViewCache>(&*m_cacheview);
|
||||
m_connect_block_view = std::make_unique<CoinsViewOverlay>(&*m_cacheview);
|
||||
}
|
||||
|
||||
Chainstate::Chainstate(
|
||||
|
||||
Reference in New Issue
Block a user