mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Add stop_block out arg to ScanForWalletTransactions
Accurately reports the last block successfully scanned, replacing a return of the chain tip, which represented possibly inaccurated data in a race condition.
This commit is contained in:
@@ -147,11 +147,12 @@ void TestGUI()
|
||||
WalletRescanReserver reserver(wallet.get());
|
||||
reserver.reserve();
|
||||
const CBlockIndex* const null_block = nullptr;
|
||||
const CBlockIndex* stop_block;
|
||||
const CBlockIndex *stop_block, *failed_block;
|
||||
QCOMPARE(
|
||||
wallet->ScanForWalletTransactions(chainActive.Genesis(), nullptr, reserver, stop_block, true /* fUpdate */),
|
||||
wallet->ScanForWalletTransactions(chainActive.Genesis(), nullptr, reserver, failed_block, stop_block, true /* fUpdate */),
|
||||
CWallet::ScanResult::SUCCESS);
|
||||
QCOMPARE(stop_block, null_block);
|
||||
QCOMPARE(stop_block, chainActive.Tip());
|
||||
QCOMPARE(failed_block, null_block);
|
||||
}
|
||||
wallet->SetBroadcastTransactions(true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user