merge bitcoin#13806: Fix bench/block_assemble assert failure

This commit is contained in:
Kittywhiskers Van Gogh 2018-07-30 11:33:05 -04:00
parent a86b67d040
commit f71a9e586e

View File

@ -97,11 +97,15 @@ static void AssembleBlock(benchmark::Bench& bench)
if (NUM_BLOCKS - b >= COINBASE_MATURITY)
txs.at(b) = MakeTransactionRef(tx);
}
{
LOCK(::cs_main); // Required for ::AcceptToMemoryPool.
for (const auto& txr : txs) {
CValidationState state;
bool ret{::AcceptToMemoryPool(::mempool, state, txr, nullptr /* pfMissingInputs */, false /* bypass_limits */, /* nAbsurdFee */ 0)};
assert(ret);
}
}
bench.minEpochIterations(700).run([&] {
PrepareBlock(SCRIPT_PUB);