Changeset View
Changeset View
Standalone View
Standalone View
src/bench/chained_tx.cpp
Show First 20 Lines • Show All 197 Lines • ▼ Show 20 Lines | for (const auto &chain : chains) { | ||||
} | } | ||||
} | } | ||||
CBlockIndex *mostWorkTip = activeChainState.m_chain.Tip(); | CBlockIndex *mostWorkTip = activeChainState.m_chain.Tip(); | ||||
bench.run([&] { | bench.run([&] { | ||||
BlockValidationState state; | BlockValidationState state; | ||||
// Disconnect blocks with long transaction chains | // Disconnect blocks with long transaction chains | ||||
activeChainState.InvalidateBlock(config, state, blockToInvalidate); | activeChainState.InvalidateBlock(state, blockToInvalidate); | ||||
assert(state.IsValid()); | assert(state.IsValid()); | ||||
activeChainState.ActivateBestChain(state); | activeChainState.ActivateBestChain(state); | ||||
assert(state.IsValid()); | assert(state.IsValid()); | ||||
assert(activeChainState.m_chain.Tip() == tipBeforeInvalidate); | assert(activeChainState.m_chain.Tip() == tipBeforeInvalidate); | ||||
// Transactions should be stuffed back into the mempool. | // Transactions should be stuffed back into the mempool. | ||||
assert(mempool.size() == reorgDepth * chainSizePerBlock); | assert(mempool.size() == reorgDepth * chainSizePerBlock); | ||||
▲ Show 20 Lines • Show All 247 Lines • Show Last 20 Lines |