aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorMeshCollider <dobsonsa68@gmail.com>2019-01-30 13:02:27 +1300
committerMeshCollider <dobsonsa68@gmail.com>2019-01-30 13:03:32 +1300
commit72ca72e6370e4fabb40510f80c00b8863322aa50 (patch)
treea9114a45fae207d667f2e0a41bcff4bc6c97f60a /src/qt
parent2d790e82c809c3be2c68376964b6d453b8525caf (diff)
parent44de1561aaf7556bb8ae8b582c233742ff76767d (diff)
downloadbitcoin-72ca72e6370e4fabb40510f80c00b8863322aa50.tar.xz
Merge #14711: Remove uses of chainActive and mapBlockIndex in wallet code
44de1561a Remove remaining chainActive references from CWallet (Russell Yanofsky) db21f0264 Convert CWallet::ScanForWalletTransactions and SyncTransaction to the new Chain apis (Russell Yanofsky) 2ffb07929 Add findFork and findBlock to the Chain interface (Russell Yanofsky) d93c4c1d6 Add time methods to the Chain interface (Russell Yanofsky) 700c42b85 Add height, depth, and hash methods to the Chain interface (Russell Yanofsky) Pull request description: This change removes uses of `chainActive` and `mapBlockIndex` globals in wallet code. It is a refactoring change which does not affect external behavior. This is the next step in the larger #10973 refactoring change, which removes all other accesses to node global variables from wallet code. Doing this is useful to provide a better defined interface between the wallet and node, and necessary to allow wallet and node code to run in separate processes in #10102. Tree-SHA512: 4dcec8a31c458f54e2ea6ecf01e430469b0994c5b41a21a2d150efa67cd209f4c93ae210a101e064b3a87c52c6edfc70b070e979992be0e3a00fd425de6230a8
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/test/wallettests.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/qt/test/wallettests.cpp b/src/qt/test/wallettests.cpp
index 610d83acb6..ee84da0cdf 100644
--- a/src/qt/test/wallettests.cpp
+++ b/src/qt/test/wallettests.cpp
@@ -1,6 +1,7 @@
#include <qt/test/wallettests.h>
#include <qt/test/util.h>
+#include <init.h>
#include <interfaces/chain.h>
#include <interfaces/node.h>
#include <base58.h>
@@ -146,13 +147,10 @@ void TestGUI()
auto locked_chain = wallet->chain().lock();
WalletRescanReserver reserver(wallet.get());
reserver.reserve();
- const CBlockIndex* const null_block = nullptr;
- const CBlockIndex *stop_block, *failed_block;
- QCOMPARE(
- wallet->ScanForWalletTransactions(chainActive.Genesis(), nullptr, reserver, failed_block, stop_block, true /* fUpdate */),
- CWallet::ScanResult::SUCCESS);
- QCOMPARE(stop_block, chainActive.Tip());
- QCOMPARE(failed_block, null_block);
+ CWallet::ScanResult result = wallet->ScanForWalletTransactions(locked_chain->getBlockHash(0), {} /* stop_block */, reserver, true /* fUpdate */);
+ QCOMPARE(result.status, CWallet::ScanResult::SUCCESS);
+ QCOMPARE(result.stop_block, chainActive.Tip()->GetBlockHash());
+ QVERIFY(result.failed_block.IsNull());
}
wallet->SetBroadcastTransactions(true);