Return a status enum from ScanForWalletTransactions

Return the failed block as an out var.

This clarifies the outcome as the prior return value could
be null due to user abort or failure.
This commit is contained in:
Ben Woosley committed 2018-11-13 00:04:13 -05:00
1 parent bb24d68650
commit 3002d6cf31
6 files changed
+68 -32

No files matched your search

+6 -1
View File
@@ -146,7 +146,12 @@ void TestGUI()
auto locked_chain = wallet->chain().lock();
WalletRescanReserver reserver(wallet.get());
reserver.reserve();
wallet->ScanForWalletTransactions(chainActive.Genesis(), nullptr, reserver, true);
const CBlockIndex* const null_block = nullptr;
const CBlockIndex* stop_block;
QCOMPARE(
wallet->ScanForWalletTransactions(chainActive.Genesis(), nullptr, reserver, stop_block, true /* fUpdate */),
CWallet::ScanResult::SUCCESS);
QCOMPARE(stop_block, null_block);
}
wallet->SetBroadcastTransactions(true);