Skip to content

Commit ade5f87

Browse files
committed
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.
1 parent f6da44c commit ade5f87

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/qt/test/wallettests.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,9 @@ void TestGUI(interfaces::Node& node)
151151
wallet->SetLastBlockProcessed(105, ::ChainActive().Tip()->GetBlockHash());
152152
}
153153
{
154-
auto locked_chain = wallet->chain().lock();
155-
LockAssertion lock(::cs_main);
156-
157154
WalletRescanReserver reserver(wallet.get());
158155
reserver.reserve();
159-
CWallet::ScanResult result = wallet->ScanForWalletTransactions(locked_chain->getBlockHash(0), {} /* stop_block */, reserver, true /* fUpdate */);
156+
CWallet::ScanResult result = wallet->ScanForWalletTransactions(Params().GetConsensus().hashGenesisBlock, {} /* stop_block */, reserver, true /* fUpdate */);
160157
QCOMPARE(result.status, CWallet::ScanResult::SUCCESS);
161158
QCOMPARE(result.last_scanned_block, ::ChainActive().Tip()->GetBlockHash());
162159
QVERIFY(result.last_failed_block.IsNull());

0 commit comments

Comments
 (0)