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:
Russell Yanofsky 2020-01-16 16:13:15 -05:00
parent f6da44ccce
commit ade5f87971

View file

@ -151,12 +151,9 @@ void TestGUI(interfaces::Node& node)
wallet->SetLastBlockProcessed(105, ::ChainActive().Tip()->GetBlockHash());
}
{
auto locked_chain = wallet->chain().lock();
LockAssertion lock(::cs_main);
WalletRescanReserver reserver(wallet.get());
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.last_scanned_block, ::ChainActive().Tip()->GetBlockHash());
QVERIFY(result.last_failed_block.IsNull());