aboutsummaryrefslogtreecommitdiff
path: root/src/qt/test/wallettests.cpp
diff options
context:
space:
mode:
authorBen Woosley <[email protected]>2018-11-13 04:57:10 +0000
committerBen Woosley <[email protected]>2018-11-13 12:51:16 -0500
commitbd3b0361d840bff95988a048abf70ade94d80524 (patch)
tree4c542682c6aac615aa2cc1760fef4faba7195d52 /src/qt/test/wallettests.cpp
parentReturn a status enum from ScanForWalletTransactions (diff)
downloaddiscoin-bd3b0361d840bff95988a048abf70ade94d80524.tar.xz
discoin-bd3b0361d840bff95988a048abf70ade94d80524.zip
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.
Diffstat (limited to 'src/qt/test/wallettests.cpp')
-rw-r--r--src/qt/test/wallettests.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/qt/test/wallettests.cpp b/src/qt/test/wallettests.cpp
index 5646070a3..610d83acb 100644
--- a/src/qt/test/wallettests.cpp
+++ b/src/qt/test/wallettests.cpp
@@ -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);