mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 10:38:42 +01:00
Acquire cs_main before ATMP call in block_assemble bench
Otherwise we fail an assert in sync.cpp:AssertLockHeldInternal.
This commit is contained in:
parent
63d73f5bc8
commit
6f53edb395
@ -97,10 +97,14 @@ static void AssembleBlock(benchmark::State& state)
|
||||
if (NUM_BLOCKS - b >= COINBASE_MATURITY)
|
||||
txs.at(b) = MakeTransactionRef(tx);
|
||||
}
|
||||
for (const auto& txr : txs) {
|
||||
CValidationState state;
|
||||
bool ret{::AcceptToMemoryPool(::mempool, state, txr, nullptr /* pfMissingInputs */, nullptr /* plTxnReplaced */, false /* bypass_limits */, /* nAbsurdFee */ 0)};
|
||||
assert(ret);
|
||||
{
|
||||
LOCK(::cs_main); // Required for ::AcceptToMemoryPool.
|
||||
|
||||
for (const auto& txr : txs) {
|
||||
CValidationState state;
|
||||
bool ret{::AcceptToMemoryPool(::mempool, state, txr, nullptr /* pfMissingInputs */, nullptr /* plTxnReplaced */, false /* bypass_limits */, /* nAbsurdFee */ 0)};
|
||||
assert(ret);
|
||||
}
|
||||
}
|
||||
|
||||
while (state.KeepRunning()) {
|
||||
|
Loading…
Reference in New Issue
Block a user