mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-10 10:52:31 -05:00
wallet refactor: Avoid use of Chain::Lock in qt wallettests
This is a step toward removing the Chain::Lock class and reducing cs_main locking. This change doesn't affect behavior.
This commit is contained in:
parent
f6da44ccce
commit
ade5f87971
1 changed files with 1 additions and 4 deletions
|
@ -151,12 +151,9 @@ void TestGUI(interfaces::Node& node)
|
||||||
wallet->SetLastBlockProcessed(105, ::ChainActive().Tip()->GetBlockHash());
|
wallet->SetLastBlockProcessed(105, ::ChainActive().Tip()->GetBlockHash());
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
auto locked_chain = wallet->chain().lock();
|
|
||||||
LockAssertion lock(::cs_main);
|
|
||||||
|
|
||||||
WalletRescanReserver reserver(wallet.get());
|
WalletRescanReserver reserver(wallet.get());
|
||||||
reserver.reserve();
|
reserver.reserve();
|
||||||
CWallet::ScanResult result = wallet->ScanForWalletTransactions(locked_chain->getBlockHash(0), {} /* stop_block */, reserver, true /* fUpdate */);
|
CWallet::ScanResult result = wallet->ScanForWalletTransactions(Params().GetConsensus().hashGenesisBlock, {} /* stop_block */, reserver, true /* fUpdate */);
|
||||||
QCOMPARE(result.status, CWallet::ScanResult::SUCCESS);
|
QCOMPARE(result.status, CWallet::ScanResult::SUCCESS);
|
||||||
QCOMPARE(result.last_scanned_block, ::ChainActive().Tip()->GetBlockHash());
|
QCOMPARE(result.last_scanned_block, ::ChainActive().Tip()->GetBlockHash());
|
||||||
QVERIFY(result.last_failed_block.IsNull());
|
QVERIFY(result.last_failed_block.IsNull());
|
||||||
|
|
Loading…
Add table
Reference in a new issue