Merge ae6943620a into merged_master (Bitcoin PR #17407)

This commit is contained in:
Andrew Poelstra 2020-11-09 23:10:14 +00:00
commit fcc3e6c04c
11 changed files with 100 additions and 75 deletions

View file

@ -282,7 +282,7 @@ BOOST_AUTO_TEST_CASE(mempool_locks_reorg)
std::list<CTransactionRef> plTxnReplaced;
for (const auto& tx : txs) {
BOOST_REQUIRE(AcceptToMemoryPool(
::mempool,
*m_node.mempool,
state,
tx,
&plTxnReplaced,
@ -293,8 +293,8 @@ BOOST_AUTO_TEST_CASE(mempool_locks_reorg)
// Check that all txs are in the pool
{
LOCK(::mempool.cs);
BOOST_CHECK_EQUAL(::mempool.mapTx.size(), txs.size());
LOCK(m_node.mempool->cs);
BOOST_CHECK_EQUAL(m_node.mempool->mapTx.size(), txs.size());
}
// Run a thread that simulates an RPC caller that is polling while
@ -304,8 +304,8 @@ BOOST_AUTO_TEST_CASE(mempool_locks_reorg)
// the transactions invalidated by the reorg, or none of them, and
// not some intermediate amount.
while (true) {
LOCK(::mempool.cs);
if (::mempool.mapTx.size() == 0) {
LOCK(m_node.mempool->cs);
if (m_node.mempool->mapTx.size() == 0) {
// We are done with the reorg
break;
}
@ -314,7 +314,7 @@ BOOST_AUTO_TEST_CASE(mempool_locks_reorg)
// be atomic. So the caller assumes that the returned mempool
// is consistent. That is, it has all txs that were there
// before the reorg.
assert(::mempool.mapTx.size() == txs.size());
assert(m_node.mempool->mapTx.size() == txs.size());
continue;
}
LOCK(cs_main);