Skip to content

Commit

Permalink
wallet refactor: Avoid use of Chain::Lock in qt wallettests
Browse files Browse the repository at this point in the history
This is a step toward removing the Chain::Lock class and reducing cs_main
locking.

This change doesn't affect behavior.
  • Loading branch information
ryanofsky committed Mar 31, 2020
1 parent f6da44c commit ade5f87
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/qt/test/wallettests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit ade5f87

Please sign in to comment.