Skip to content

Commit fa53881

Browse files
author
MarcoFalke
committed
scripted-diff: Replace ::mempool with m_node.mempool in tests
-BEGIN VERIFY SCRIPT- # tx pool member access (mempool followed by dot) sed --regexp-extended -i -e 's/(::)?\<mempool\>\.([a-zA-Z])/m_node.mempool->\2/g' $(git grep -l mempool ./src/test) # plain global (mempool not preceeded by dot, but followed by comma) sed --regexp-extended -i -e 's/([^\.])(::)?\<mempool\>,/\1*m_node.mempool,/g' $(git grep -l mempool ./src/test) -END VERIFY SCRIPT-
1 parent 8888ad0 commit fa53881

File tree

4 files changed

+52
-52
lines changed

4 files changed

+52
-52
lines changed

src/test/miner_tests.cpp

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -118,19 +118,19 @@ void MinerTestingSetup::TestPackageSelection(const CChainParams& chainparams, co
118118
tx.vout[0].nValue = 5000000000LL - 1000;
119119
// This tx has a low fee: 1000 satoshis
120120
uint256 hashParentTx = tx.GetHash(); // save this txid for later use
121-
mempool.addUnchecked(entry.Fee(1000).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
121+
m_node.mempool->addUnchecked(entry.Fee(1000).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
122122

123123
// This tx has a medium fee: 10000 satoshis
124124
tx.vin[0].prevout.hash = txFirst[1]->GetHash();
125125
tx.vout[0].nValue = 5000000000LL - 10000;
126126
uint256 hashMediumFeeTx = tx.GetHash();
127-
mempool.addUnchecked(entry.Fee(10000).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
127+
m_node.mempool->addUnchecked(entry.Fee(10000).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
128128

129129
// This tx has a high fee, but depends on the first transaction
130130
tx.vin[0].prevout.hash = hashParentTx;
131131
tx.vout[0].nValue = 5000000000LL - 1000 - 50000; // 50k satoshi fee
132132
uint256 hashHighFeeTx = tx.GetHash();
133-
mempool.addUnchecked(entry.Fee(50000).Time(GetTime()).SpendsCoinbase(false).FromTx(tx));
133+
m_node.mempool->addUnchecked(entry.Fee(50000).Time(GetTime()).SpendsCoinbase(false).FromTx(tx));
134134

135135
std::unique_ptr<CBlockTemplate> pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey);
136136
BOOST_CHECK(pblocktemplate->block.vtx[1]->GetHash() == hashParentTx);
@@ -141,7 +141,7 @@ void MinerTestingSetup::TestPackageSelection(const CChainParams& chainparams, co
141141
tx.vin[0].prevout.hash = hashHighFeeTx;
142142
tx.vout[0].nValue = 5000000000LL - 1000 - 50000; // 0 fee
143143
uint256 hashFreeTx = tx.GetHash();
144-
mempool.addUnchecked(entry.Fee(0).FromTx(tx));
144+
m_node.mempool->addUnchecked(entry.Fee(0).FromTx(tx));
145145
size_t freeTxSize = ::GetSerializeSize(tx, PROTOCOL_VERSION);
146146

147147
// Calculate a fee on child transaction that will put the package just
@@ -151,7 +151,7 @@ void MinerTestingSetup::TestPackageSelection(const CChainParams& chainparams, co
151151
tx.vin[0].prevout.hash = hashFreeTx;
152152
tx.vout[0].nValue = 5000000000LL - 1000 - 50000 - feeToUse;
153153
uint256 hashLowFeeTx = tx.GetHash();
154-
mempool.addUnchecked(entry.Fee(feeToUse).FromTx(tx));
154+
m_node.mempool->addUnchecked(entry.Fee(feeToUse).FromTx(tx));
155155
pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey);
156156
// Verify that the free tx and the low fee tx didn't get selected
157157
for (size_t i=0; i<pblocktemplate->block.vtx.size(); ++i) {
@@ -162,10 +162,10 @@ void MinerTestingSetup::TestPackageSelection(const CChainParams& chainparams, co
162162
// Test that packages above the min relay fee do get included, even if one
163163
// of the transactions is below the min relay fee
164164
// Remove the low fee transaction and replace with a higher fee transaction
165-
mempool.removeRecursive(CTransaction(tx), MemPoolRemovalReason::REPLACED);
165+
m_node.mempool->removeRecursive(CTransaction(tx), MemPoolRemovalReason::REPLACED);
166166
tx.vout[0].nValue -= 2; // Now we should be just over the min relay fee
167167
hashLowFeeTx = tx.GetHash();
168-
mempool.addUnchecked(entry.Fee(feeToUse+2).FromTx(tx));
168+
m_node.mempool->addUnchecked(entry.Fee(feeToUse+2).FromTx(tx));
169169
pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey);
170170
BOOST_CHECK(pblocktemplate->block.vtx[4]->GetHash() == hashFreeTx);
171171
BOOST_CHECK(pblocktemplate->block.vtx[5]->GetHash() == hashLowFeeTx);
@@ -178,15 +178,15 @@ void MinerTestingSetup::TestPackageSelection(const CChainParams& chainparams, co
178178
tx.vout[0].nValue = 5000000000LL - 100000000;
179179
tx.vout[1].nValue = 100000000; // 1BTC output
180180
uint256 hashFreeTx2 = tx.GetHash();
181-
mempool.addUnchecked(entry.Fee(0).SpendsCoinbase(true).FromTx(tx));
181+
m_node.mempool->addUnchecked(entry.Fee(0).SpendsCoinbase(true).FromTx(tx));
182182

183183
// This tx can't be mined by itself
184184
tx.vin[0].prevout.hash = hashFreeTx2;
185185
tx.vout.resize(1);
186186
feeToUse = blockMinFeeRate.GetFee(freeTxSize);
187187
tx.vout[0].nValue = 5000000000LL - 100000000 - feeToUse;
188188
uint256 hashLowFeeTx2 = tx.GetHash();
189-
mempool.addUnchecked(entry.Fee(feeToUse).SpendsCoinbase(false).FromTx(tx));
189+
m_node.mempool->addUnchecked(entry.Fee(feeToUse).SpendsCoinbase(false).FromTx(tx));
190190
pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey);
191191

192192
// Verify that this tx isn't selected.
@@ -199,7 +199,7 @@ void MinerTestingSetup::TestPackageSelection(const CChainParams& chainparams, co
199199
// as well.
200200
tx.vin[0].prevout.n = 1;
201201
tx.vout[0].nValue = 100000000 - 10000; // 10k satoshi fee
202-
mempool.addUnchecked(entry.Fee(10000).FromTx(tx));
202+
m_node.mempool->addUnchecked(entry.Fee(10000).FromTx(tx));
203203
pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey);
204204
BOOST_CHECK(pblocktemplate->block.vtx[8]->GetHash() == hashLowFeeTx2);
205205
}
@@ -256,7 +256,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
256256
}
257257

258258
LOCK(cs_main);
259-
LOCK(::mempool.cs);
259+
LOCK(m_node.mempool->cs);
260260

261261
// Just to make sure we can still make simple blocks
262262
BOOST_CHECK(pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey));
@@ -280,12 +280,12 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
280280
hash = tx.GetHash();
281281
bool spendsCoinbase = i == 0; // only first tx spends coinbase
282282
// If we don't set the # of sig ops in the CTxMemPoolEntry, template creation fails
283-
mempool.addUnchecked(entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(spendsCoinbase).FromTx(tx));
283+
m_node.mempool->addUnchecked(entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(spendsCoinbase).FromTx(tx));
284284
tx.vin[0].prevout.hash = hash;
285285
}
286286

287287
BOOST_CHECK_EXCEPTION(AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey), std::runtime_error, HasReason("bad-blk-sigops"));
288-
mempool.clear();
288+
m_node.mempool->clear();
289289

290290
tx.vin[0].prevout.hash = txFirst[0]->GetHash();
291291
tx.vout[0].nValue = BLOCKSUBSIDY;
@@ -295,11 +295,11 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
295295
hash = tx.GetHash();
296296
bool spendsCoinbase = i == 0; // only first tx spends coinbase
297297
// If we do set the # of sig ops in the CTxMemPoolEntry, template creation passes
298-
mempool.addUnchecked(entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(spendsCoinbase).SigOpsCost(80).FromTx(tx));
298+
m_node.mempool->addUnchecked(entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(spendsCoinbase).SigOpsCost(80).FromTx(tx));
299299
tx.vin[0].prevout.hash = hash;
300300
}
301301
BOOST_CHECK(pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey));
302-
mempool.clear();
302+
m_node.mempool->clear();
303303

304304
// block size > limit
305305
tx.vin[0].scriptSig = CScript();
@@ -315,59 +315,59 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
315315
tx.vout[0].nValue -= LOWFEE;
316316
hash = tx.GetHash();
317317
bool spendsCoinbase = i == 0; // only first tx spends coinbase
318-
mempool.addUnchecked(entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(spendsCoinbase).FromTx(tx));
318+
m_node.mempool->addUnchecked(entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(spendsCoinbase).FromTx(tx));
319319
tx.vin[0].prevout.hash = hash;
320320
}
321321
BOOST_CHECK(pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey));
322-
mempool.clear();
322+
m_node.mempool->clear();
323323

324-
// orphan in mempool, template creation fails
324+
// orphan in *m_node.mempool, template creation fails
325325
hash = tx.GetHash();
326-
mempool.addUnchecked(entry.Fee(LOWFEE).Time(GetTime()).FromTx(tx));
326+
m_node.mempool->addUnchecked(entry.Fee(LOWFEE).Time(GetTime()).FromTx(tx));
327327
BOOST_CHECK_EXCEPTION(AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey), std::runtime_error, HasReason("bad-txns-inputs-missingorspent"));
328-
mempool.clear();
328+
m_node.mempool->clear();
329329

330330
// child with higher feerate than parent
331331
tx.vin[0].scriptSig = CScript() << OP_1;
332332
tx.vin[0].prevout.hash = txFirst[1]->GetHash();
333333
tx.vout[0].nValue = BLOCKSUBSIDY-HIGHFEE;
334334
hash = tx.GetHash();
335-
mempool.addUnchecked(entry.Fee(HIGHFEE).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
335+
m_node.mempool->addUnchecked(entry.Fee(HIGHFEE).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
336336
tx.vin[0].prevout.hash = hash;
337337
tx.vin.resize(2);
338338
tx.vin[1].scriptSig = CScript() << OP_1;
339339
tx.vin[1].prevout.hash = txFirst[0]->GetHash();
340340
tx.vin[1].prevout.n = 0;
341341
tx.vout[0].nValue = tx.vout[0].nValue+BLOCKSUBSIDY-HIGHERFEE; //First txn output + fresh coinbase - new txn fee
342342
hash = tx.GetHash();
343-
mempool.addUnchecked(entry.Fee(HIGHERFEE).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
343+
m_node.mempool->addUnchecked(entry.Fee(HIGHERFEE).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
344344
BOOST_CHECK(pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey));
345-
mempool.clear();
345+
m_node.mempool->clear();
346346

347-
// coinbase in mempool, template creation fails
347+
// coinbase in *m_node.mempool, template creation fails
348348
tx.vin.resize(1);
349349
tx.vin[0].prevout.SetNull();
350350
tx.vin[0].scriptSig = CScript() << OP_0 << OP_1;
351351
tx.vout[0].nValue = 0;
352352
hash = tx.GetHash();
353353
// give it a fee so it'll get mined
354-
mempool.addUnchecked(entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(false).FromTx(tx));
354+
m_node.mempool->addUnchecked(entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(false).FromTx(tx));
355355
// Should throw bad-cb-multiple
356356
BOOST_CHECK_EXCEPTION(AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey), std::runtime_error, HasReason("bad-cb-multiple"));
357-
mempool.clear();
357+
m_node.mempool->clear();
358358

359-
// double spend txn pair in mempool, template creation fails
359+
// double spend txn pair in *m_node.mempool, template creation fails
360360
tx.vin[0].prevout.hash = txFirst[0]->GetHash();
361361
tx.vin[0].scriptSig = CScript() << OP_1;
362362
tx.vout[0].nValue = BLOCKSUBSIDY-HIGHFEE;
363363
tx.vout[0].scriptPubKey = CScript() << OP_1;
364364
hash = tx.GetHash();
365-
mempool.addUnchecked(entry.Fee(HIGHFEE).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
365+
m_node.mempool->addUnchecked(entry.Fee(HIGHFEE).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
366366
tx.vout[0].scriptPubKey = CScript() << OP_2;
367367
hash = tx.GetHash();
368-
mempool.addUnchecked(entry.Fee(HIGHFEE).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
368+
m_node.mempool->addUnchecked(entry.Fee(HIGHFEE).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
369369
BOOST_CHECK_EXCEPTION(AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey), std::runtime_error, HasReason("bad-txns-inputs-missingorspent"));
370-
mempool.clear();
370+
m_node.mempool->clear();
371371

372372
// subsidy changing
373373
int nHeight = ::ChainActive().Height();
@@ -396,23 +396,23 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
396396
}
397397
BOOST_CHECK(pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey));
398398

399-
// invalid p2sh txn in mempool, template creation fails
399+
// invalid p2sh txn in *m_node.mempool, template creation fails
400400
tx.vin[0].prevout.hash = txFirst[0]->GetHash();
401401
tx.vin[0].prevout.n = 0;
402402
tx.vin[0].scriptSig = CScript() << OP_1;
403403
tx.vout[0].nValue = BLOCKSUBSIDY-LOWFEE;
404404
script = CScript() << OP_0;
405405
tx.vout[0].scriptPubKey = GetScriptForDestination(ScriptHash(script));
406406
hash = tx.GetHash();
407-
mempool.addUnchecked(entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
407+
m_node.mempool->addUnchecked(entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
408408
tx.vin[0].prevout.hash = hash;
409409
tx.vin[0].scriptSig = CScript() << std::vector<unsigned char>(script.begin(), script.end());
410410
tx.vout[0].nValue -= LOWFEE;
411411
hash = tx.GetHash();
412-
mempool.addUnchecked(entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(false).FromTx(tx));
412+
m_node.mempool->addUnchecked(entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(false).FromTx(tx));
413413
// Should throw block-validation-failed
414414
BOOST_CHECK_EXCEPTION(AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey), std::runtime_error, HasReason("block-validation-failed"));
415-
mempool.clear();
415+
m_node.mempool->clear();
416416

417417
// Delete the dummy blocks again.
418418
while (::ChainActive().Tip()->nHeight > nHeight) {
@@ -443,7 +443,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
443443
tx.vout[0].scriptPubKey = CScript() << OP_1;
444444
tx.nLockTime = 0;
445445
hash = tx.GetHash();
446-
mempool.addUnchecked(entry.Fee(HIGHFEE).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
446+
m_node.mempool->addUnchecked(entry.Fee(HIGHFEE).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
447447
BOOST_CHECK(CheckFinalTx(CTransaction(tx), flags)); // Locktime passes
448448
BOOST_CHECK(!TestSequenceLocks(CTransaction(tx), flags)); // Sequence locks fail
449449
BOOST_CHECK(SequenceLocks(CTransaction(tx), flags, &prevheights, CreateBlockIndex(::ChainActive().Tip()->nHeight + 2))); // Sequence locks pass on 2nd block
@@ -453,7 +453,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
453453
tx.vin[0].nSequence = CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG | (((::ChainActive().Tip()->GetMedianTimePast()+1-::ChainActive()[1]->GetMedianTimePast()) >> CTxIn::SEQUENCE_LOCKTIME_GRANULARITY) + 1); // txFirst[1] is the 3rd block
454454
prevheights[0] = baseheight + 2;
455455
hash = tx.GetHash();
456-
mempool.addUnchecked(entry.Time(GetTime()).FromTx(tx));
456+
m_node.mempool->addUnchecked(entry.Time(GetTime()).FromTx(tx));
457457
BOOST_CHECK(CheckFinalTx(CTransaction(tx), flags)); // Locktime passes
458458
BOOST_CHECK(!TestSequenceLocks(CTransaction(tx), flags)); // Sequence locks fail
459459

@@ -469,7 +469,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
469469
prevheights[0] = baseheight + 3;
470470
tx.nLockTime = ::ChainActive().Tip()->nHeight + 1;
471471
hash = tx.GetHash();
472-
mempool.addUnchecked(entry.Time(GetTime()).FromTx(tx));
472+
m_node.mempool->addUnchecked(entry.Time(GetTime()).FromTx(tx));
473473
BOOST_CHECK(!CheckFinalTx(CTransaction(tx), flags)); // Locktime fails
474474
BOOST_CHECK(TestSequenceLocks(CTransaction(tx), flags)); // Sequence locks pass
475475
BOOST_CHECK(IsFinalTx(CTransaction(tx), ::ChainActive().Tip()->nHeight + 2, ::ChainActive().Tip()->GetMedianTimePast())); // Locktime passes on 2nd block
@@ -480,7 +480,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
480480
prevheights.resize(1);
481481
prevheights[0] = baseheight + 4;
482482
hash = tx.GetHash();
483-
mempool.addUnchecked(entry.Time(GetTime()).FromTx(tx));
483+
m_node.mempool->addUnchecked(entry.Time(GetTime()).FromTx(tx));
484484
BOOST_CHECK(!CheckFinalTx(CTransaction(tx), flags)); // Locktime fails
485485
BOOST_CHECK(TestSequenceLocks(CTransaction(tx), flags)); // Sequence locks pass
486486
BOOST_CHECK(IsFinalTx(CTransaction(tx), ::ChainActive().Tip()->nHeight + 2, ::ChainActive().Tip()->GetMedianTimePast() + 1)); // Locktime passes 1 second later
@@ -517,7 +517,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
517517

518518
::ChainActive().Tip()->nHeight--;
519519
SetMockTime(0);
520-
mempool.clear();
520+
m_node.mempool->clear();
521521

522522
TestPackageSelection(chainparams, scriptPubKey, txFirst);
523523

src/test/txvalidation_tests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@ BOOST_FIXTURE_TEST_CASE(tx_mempool_reject_coinbase, TestChain100Setup)
3434

3535
LOCK(cs_main);
3636

37-
unsigned int initialPoolSize = mempool.size();
37+
unsigned int initialPoolSize = m_node.mempool->size();
3838

3939
BOOST_CHECK_EQUAL(
4040
false,
41-
AcceptToMemoryPool(mempool, state, MakeTransactionRef(coinbaseTx),
41+
AcceptToMemoryPool(*m_node.mempool, state, MakeTransactionRef(coinbaseTx),
4242
nullptr /* plTxnReplaced */,
4343
true /* bypass_limits */,
4444
0 /* nAbsurdFee */));
4545

4646
// Check that the transaction hasn't been added to mempool.
47-
BOOST_CHECK_EQUAL(mempool.size(), initialPoolSize);
47+
BOOST_CHECK_EQUAL(m_node.mempool->size(), initialPoolSize);
4848

4949
// Check that the validation state reflects the unsuccessful attempt.
5050
BOOST_CHECK(state.IsInvalid());

src/test/txvalidationcache_tests.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ BOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, TestChain100Setup)
7070
LOCK(cs_main);
7171
BOOST_CHECK(::ChainActive().Tip()->GetBlockHash() != block.GetHash());
7272
}
73-
mempool.clear();
73+
m_node.mempool->clear();
7474

7575
// Test 3: ... and should be rejected if spend2 is in the memory pool
7676
BOOST_CHECK(ToMemPool(spends[1]));
@@ -79,9 +79,9 @@ BOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, TestChain100Setup)
7979
LOCK(cs_main);
8080
BOOST_CHECK(::ChainActive().Tip()->GetBlockHash() != block.GetHash());
8181
}
82-
mempool.clear();
82+
m_node.mempool->clear();
8383

84-
// Final sanity test: first spend in mempool, second in block, that's OK:
84+
// Final sanity test: first spend in *m_node.mempool, second in block, that's OK:
8585
std::vector<CMutableTransaction> oneSpend;
8686
oneSpend.push_back(spends[0]);
8787
BOOST_CHECK(ToMemPool(spends[1]));
@@ -92,7 +92,7 @@ BOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, TestChain100Setup)
9292
}
9393
// spends[1] should have been removed from the mempool when the
9494
// block with spends[0] is accepted:
95-
BOOST_CHECK_EQUAL(mempool.size(), 0U);
95+
BOOST_CHECK_EQUAL(m_node.mempool->size(), 0U);
9696
}
9797

9898
// Run CheckInputs (using CoinsTip()) on the given transaction, for all script

src/test/validation_block_tests.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ BOOST_AUTO_TEST_CASE(mempool_locks_reorg)
278278
std::list<CTransactionRef> plTxnReplaced;
279279
for (const auto& tx : txs) {
280280
BOOST_REQUIRE(AcceptToMemoryPool(
281-
::mempool,
281+
*m_node.mempool,
282282
state,
283283
tx,
284284
&plTxnReplaced,
@@ -289,8 +289,8 @@ BOOST_AUTO_TEST_CASE(mempool_locks_reorg)
289289

290290
// Check that all txs are in the pool
291291
{
292-
LOCK(::mempool.cs);
293-
BOOST_CHECK_EQUAL(::mempool.mapTx.size(), txs.size());
292+
LOCK(m_node.mempool->cs);
293+
BOOST_CHECK_EQUAL(m_node.mempool->mapTx.size(), txs.size());
294294
}
295295

296296
// Run a thread that simulates an RPC caller that is polling while
@@ -300,8 +300,8 @@ BOOST_AUTO_TEST_CASE(mempool_locks_reorg)
300300
// the transactions invalidated by the reorg, or none of them, and
301301
// not some intermediate amount.
302302
while (true) {
303-
LOCK(::mempool.cs);
304-
if (::mempool.mapTx.size() == 0) {
303+
LOCK(m_node.mempool->cs);
304+
if (m_node.mempool->mapTx.size() == 0) {
305305
// We are done with the reorg
306306
break;
307307
}
@@ -310,7 +310,7 @@ BOOST_AUTO_TEST_CASE(mempool_locks_reorg)
310310
// be atomic. So the caller assumes that the returned mempool
311311
// is consistent. That is, it has all txs that were there
312312
// before the reorg.
313-
assert(::mempool.mapTx.size() == txs.size());
313+
assert(m_node.mempool->mapTx.size() == txs.size());
314314
continue;
315315
}
316316
LOCK(cs_main);

0 commit comments

Comments
 (0)