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
1 changed files with 8 additions and 4 deletions
|
@ -97,10 +97,14 @@ static void AssembleBlock(benchmark::State& state)
|
||||||
if (NUM_BLOCKS - b >= COINBASE_MATURITY)
|
if (NUM_BLOCKS - b >= COINBASE_MATURITY)
|
||||||
txs.at(b) = MakeTransactionRef(tx);
|
txs.at(b) = MakeTransactionRef(tx);
|
||||||
}
|
}
|
||||||
for (const auto& txr : txs) {
|
{
|
||||||
CValidationState state;
|
LOCK(::cs_main); // Required for ::AcceptToMemoryPool.
|
||||||
bool ret{::AcceptToMemoryPool(::mempool, state, txr, nullptr /* pfMissingInputs */, nullptr /* plTxnReplaced */, false /* bypass_limits */, /* nAbsurdFee */ 0)};
|
|
||||||
assert(ret);
|
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()) {
|
while (state.KeepRunning()) {
|
||||||
|
|
Loading…
Reference in a new issue