@@ -83,17 +83,17 @@ static void AddKey(CWallet& wallet, const CKey& key)
83
83
BOOST_FIXTURE_TEST_CASE (scan_for_wallet_transactions, TestChain100Setup)
84
84
{
85
85
// Cap last block file size, and mine new block in a new block file.
86
- CBlockIndex* oldTip = :: ChainActive ().Tip ();
86
+ CBlockIndex* oldTip = m_node. chainman -> ActiveChain ().Tip ();
87
87
GetBlockFileInfo (oldTip->GetBlockPos ().nFile )->nSize = MAX_BLOCKFILE_SIZE;
88
88
CreateAndProcessBlock ({}, GetScriptForRawPubKey (coinbaseKey.GetPubKey ()));
89
- CBlockIndex* newTip = :: ChainActive ().Tip ();
89
+ CBlockIndex* newTip = m_node. chainman -> ActiveChain ().Tip ();
90
90
91
91
// Verify ScanForWalletTransactions fails to read an unknown start block.
92
92
{
93
93
CWallet wallet (m_node.chain .get (), " " , CreateDummyWalletDatabase ());
94
94
{
95
95
LOCK (wallet.cs_wallet );
96
- wallet.SetLastBlockProcessed (:: ChainActive ().Height (), :: ChainActive ().Tip ()->GetBlockHash ());
96
+ wallet.SetLastBlockProcessed (m_node. chainman -> ActiveChain ().Height (), m_node. chainman -> ActiveChain ().Tip ()->GetBlockHash ());
97
97
}
98
98
AddKey (wallet, coinbaseKey);
99
99
WalletRescanReserver reserver (wallet);
@@ -112,7 +112,7 @@ BOOST_FIXTURE_TEST_CASE(scan_for_wallet_transactions, TestChain100Setup)
112
112
CWallet wallet (m_node.chain .get (), " " , CreateDummyWalletDatabase ());
113
113
{
114
114
LOCK (wallet.cs_wallet );
115
- wallet.SetLastBlockProcessed (:: ChainActive ().Height (), :: ChainActive ().Tip ()->GetBlockHash ());
115
+ wallet.SetLastBlockProcessed (m_node. chainman -> ActiveChain ().Height (), m_node. chainman -> ActiveChain ().Tip ()->GetBlockHash ());
116
116
}
117
117
AddKey (wallet, coinbaseKey);
118
118
WalletRescanReserver reserver (wallet);
@@ -138,7 +138,7 @@ BOOST_FIXTURE_TEST_CASE(scan_for_wallet_transactions, TestChain100Setup)
138
138
CWallet wallet (m_node.chain .get (), " " , CreateDummyWalletDatabase ());
139
139
{
140
140
LOCK (wallet.cs_wallet );
141
- wallet.SetLastBlockProcessed (:: ChainActive ().Height (), :: ChainActive ().Tip ()->GetBlockHash ());
141
+ wallet.SetLastBlockProcessed (m_node. chainman -> ActiveChain ().Height (), m_node. chainman -> ActiveChain ().Tip ()->GetBlockHash ());
142
142
}
143
143
AddKey (wallet, coinbaseKey);
144
144
WalletRescanReserver reserver (wallet);
@@ -163,7 +163,7 @@ BOOST_FIXTURE_TEST_CASE(scan_for_wallet_transactions, TestChain100Setup)
163
163
CWallet wallet (m_node.chain .get (), " " , CreateDummyWalletDatabase ());
164
164
{
165
165
LOCK (wallet.cs_wallet );
166
- wallet.SetLastBlockProcessed (:: ChainActive ().Height (), :: ChainActive ().Tip ()->GetBlockHash ());
166
+ wallet.SetLastBlockProcessed (m_node. chainman -> ActiveChain ().Height (), m_node. chainman -> ActiveChain ().Tip ()->GetBlockHash ());
167
167
}
168
168
AddKey (wallet, coinbaseKey);
169
169
WalletRescanReserver reserver (wallet);
@@ -180,10 +180,10 @@ BOOST_FIXTURE_TEST_CASE(scan_for_wallet_transactions, TestChain100Setup)
180
180
BOOST_FIXTURE_TEST_CASE (importmulti_rescan, TestChain100Setup)
181
181
{
182
182
// Cap last block file size, and mine new block in a new block file.
183
- CBlockIndex* oldTip = :: ChainActive ().Tip ();
183
+ CBlockIndex* oldTip = m_node. chainman -> ActiveChain ().Tip ();
184
184
GetBlockFileInfo (oldTip->GetBlockPos ().nFile )->nSize = MAX_BLOCKFILE_SIZE;
185
185
CreateAndProcessBlock ({}, GetScriptForRawPubKey (coinbaseKey.GetPubKey ()));
186
- CBlockIndex* newTip = :: ChainActive ().Tip ();
186
+ CBlockIndex* newTip = m_node. chainman -> ActiveChain ().Tip ();
187
187
188
188
// Prune the older block file.
189
189
{
@@ -242,7 +242,7 @@ BOOST_FIXTURE_TEST_CASE(importwallet_rescan, TestChain100Setup)
242
242
{
243
243
// Create two blocks with same timestamp to verify that importwallet rescan
244
244
// will pick up both blocks, not just the first.
245
- const int64_t BLOCK_TIME = :: ChainActive ().Tip ()->GetBlockTimeMax () + 5 ;
245
+ const int64_t BLOCK_TIME = m_node. chainman -> ActiveChain ().Tip ()->GetBlockTimeMax () + 5 ;
246
246
SetMockTime (BLOCK_TIME);
247
247
m_coinbase_txns.emplace_back (CreateAndProcessBlock ({}, GetScriptForRawPubKey (coinbaseKey.GetPubKey ())).vtx [0 ]);
248
248
m_coinbase_txns.emplace_back (CreateAndProcessBlock ({}, GetScriptForRawPubKey (coinbaseKey.GetPubKey ())).vtx [0 ]);
@@ -265,7 +265,7 @@ BOOST_FIXTURE_TEST_CASE(importwallet_rescan, TestChain100Setup)
265
265
spk_man->AddKeyPubKey (coinbaseKey, coinbaseKey.GetPubKey ());
266
266
267
267
AddWallet (wallet);
268
- wallet->SetLastBlockProcessed (:: ChainActive ().Height (), :: ChainActive ().Tip ()->GetBlockHash ());
268
+ wallet->SetLastBlockProcessed (m_node. chainman -> ActiveChain ().Height (), m_node. chainman -> ActiveChain ().Tip ()->GetBlockHash ());
269
269
}
270
270
JSONRPCRequest request;
271
271
request.params .setArray ();
@@ -286,7 +286,7 @@ BOOST_FIXTURE_TEST_CASE(importwallet_rescan, TestChain100Setup)
286
286
request.params .setArray ();
287
287
request.params .push_back (backup_file);
288
288
AddWallet (wallet);
289
- wallet->SetLastBlockProcessed (:: ChainActive ().Height (), :: ChainActive ().Tip ()->GetBlockHash ());
289
+ wallet->SetLastBlockProcessed (m_node. chainman -> ActiveChain ().Height (), m_node. chainman -> ActiveChain ().Tip ()->GetBlockHash ());
290
290
::importwallet ().HandleRequest(request);
291
291
RemoveWallet (wallet, std::nullopt);
292
292
@@ -313,9 +313,9 @@ BOOST_FIXTURE_TEST_CASE(coin_mark_dirty_immature_credit, TestChain100Setup)
313
313
CWalletTx wtx (&wallet, m_coinbase_txns.back ());
314
314
315
315
LOCK2 (wallet.cs_wallet , spk_man->cs_KeyStore );
316
- wallet.SetLastBlockProcessed (:: ChainActive ().Height (), :: ChainActive ().Tip ()->GetBlockHash ());
316
+ wallet.SetLastBlockProcessed (m_node. chainman -> ActiveChain ().Height (), m_node. chainman -> ActiveChain ().Tip ()->GetBlockHash ());
317
317
318
- CWalletTx::Confirmation confirm (CWalletTx::Status::CONFIRMED, :: ChainActive ().Height (), :: ChainActive ().Tip ()->GetBlockHash (), 0 );
318
+ CWalletTx::Confirmation confirm (CWalletTx::Status::CONFIRMED, m_node. chainman -> ActiveChain ().Height (), m_node. chainman -> ActiveChain ().Tip ()->GetBlockHash (), 0 );
319
319
wtx.m_confirm = confirm;
320
320
321
321
// Call GetImmatureCredit() once before adding the key to the wallet to
@@ -483,16 +483,16 @@ class ListCoinsTestingSetup : public TestChain100Setup
483
483
wallet = std::make_unique<CWallet>(m_node.chain .get (), " " , CreateMockWalletDatabase ());
484
484
{
485
485
LOCK2 (wallet->cs_wallet , ::cs_main);
486
- wallet->SetLastBlockProcessed (:: ChainActive ().Height (), :: ChainActive ().Tip ()->GetBlockHash ());
486
+ wallet->SetLastBlockProcessed (m_node. chainman -> ActiveChain ().Height (), m_node. chainman -> ActiveChain ().Tip ()->GetBlockHash ());
487
487
}
488
488
wallet->LoadWallet ();
489
489
AddKey (*wallet, coinbaseKey);
490
490
WalletRescanReserver reserver (*wallet);
491
491
reserver.reserve ();
492
- CWallet::ScanResult result = wallet->ScanForWalletTransactions (:: ChainActive ().Genesis ()->GetBlockHash (), 0 /* start_height */ , {} /* max_height */ , reserver, false /* update */ );
492
+ CWallet::ScanResult result = wallet->ScanForWalletTransactions (m_node. chainman -> ActiveChain ().Genesis ()->GetBlockHash (), 0 /* start_height */ , {} /* max_height */ , reserver, false /* update */ );
493
493
BOOST_CHECK_EQUAL (result.status , CWallet::ScanResult::SUCCESS);
494
- BOOST_CHECK_EQUAL (result.last_scanned_block , :: ChainActive ().Tip ()->GetBlockHash ());
495
- BOOST_CHECK_EQUAL (*result.last_scanned_height , :: ChainActive ().Height ());
494
+ BOOST_CHECK_EQUAL (result.last_scanned_block , m_node. chainman -> ActiveChain ().Tip ()->GetBlockHash ());
495
+ BOOST_CHECK_EQUAL (*result.last_scanned_height , m_node. chainman -> ActiveChain ().Height ());
496
496
BOOST_CHECK (result.last_failed_block .IsNull ());
497
497
}
498
498
@@ -521,10 +521,10 @@ class ListCoinsTestingSetup : public TestChain100Setup
521
521
CreateAndProcessBlock ({CMutableTransaction (blocktx)}, GetScriptForRawPubKey (coinbaseKey.GetPubKey ()));
522
522
523
523
LOCK (wallet->cs_wallet );
524
- wallet->SetLastBlockProcessed (wallet->GetLastBlockHeight () + 1 , :: ChainActive ().Tip ()->GetBlockHash ());
524
+ wallet->SetLastBlockProcessed (wallet->GetLastBlockHeight () + 1 , m_node. chainman -> ActiveChain ().Tip ()->GetBlockHash ());
525
525
auto it = wallet->mapWallet .find (tx->GetHash ());
526
526
BOOST_CHECK (it != wallet->mapWallet .end ());
527
- CWalletTx::Confirmation confirm (CWalletTx::Status::CONFIRMED, :: ChainActive ().Height (), :: ChainActive ().Tip ()->GetBlockHash (), 1 );
527
+ CWalletTx::Confirmation confirm (CWalletTx::Status::CONFIRMED, m_node. chainman -> ActiveChain ().Height (), m_node. chainman -> ActiveChain ().Tip ()->GetBlockHash (), 1 );
528
528
it->second .m_confirm = confirm;
529
529
return it->second ;
530
530
}
0 commit comments