-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Remove uses of chainActive and mapBlockIndex in wallet code #14711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Concept ACK. Though, I'd prefer if we first cleaned up the interface for ScanForWalletTransactions. I believe that right now it is relying on too much undefined behaviour that this refactoring could be meaningfully reviewed. |
Are you talking about a small part of this PR or the whole thing? Most of the changes here don't have anything to do with ScanForWalletTransactions. I could even drop the rescan changes and save them for a different PR if you are only worried about them. |
Concept ACK Nice readability and robustness improvement |
Concept ACK Would be easier/safer to review if split up. Like Marco, I’d like to see ScanFor improved first. |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK d568bdb
while (block && block->pprev && (block->pprev->nStatus & BLOCK_HAVE_DATA) && block->pprev->nTx > 0 && pindexRescan != block) | ||
block = block->pprev; | ||
int block_height = *tip_height; | ||
while (block_height > 0 && locked_chain->haveBlockOnDisk(block_height - 1) && rescan_height != block_height) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use findPruned(rescan_height, *tip_height)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re: #14711 (comment)
Why not use findPruned
I used haveBlockOnDisk
here because I was doing a very literal translation and findPruned
doesn't have the block->pprev->nTx > 0
condition. If can drop that condition or add it to findPruned
, though, if it would be an improvement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK.
src/wallet/rpcdump.cpp
Outdated
@@ -366,8 +366,7 @@ UniValue importprunedfunds(const JSONRPCRequest& request) | |||
if (merkleBlock.txn.ExtractMatches(vMatch, vIndex) == merkleBlock.header.hashMerkleRoot) { | |||
|
|||
auto locked_chain = pwallet->chain().lock(); | |||
const CBlockIndex* pindex = LookupBlockIndex(merkleBlock.header.GetHash()); | |||
if (!pindex || !chainActive.Contains(pindex)) { | |||
if (!locked_chain->getBlockHeight(merkleBlock.header.GetHash())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sounds wrong, as if it wants to discard genesis block (height == 0
). Only got it after seeing the return type Optional<int>
. IMO .contains(hash)
would be preferable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be more clear with a comparison with nullopt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1526,24 +1529,18 @@ static UniValue listsinceblock(const JSONRPCRequest& request) | |||
auto locked_chain = pwallet->chain().lock(); | |||
LOCK(pwallet->cs_wallet); | |||
|
|||
const CBlockIndex* pindex = nullptr; // Block index of the specified block or the common ancestor, if the block provided was in a deactivated chain. | |||
const CBlockIndex* paltindex = nullptr; // Block index of the specified block, even if it's in a deactivated chain. | |||
Optional<int> height; // Height of the specified block or the common ancestor, if the block provided was in a deactivated chain. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this change conceptually different? Even though the chain is locked, this can be copied and used without the lock and therefore can "point" to other block if a reorg occurs. This wouldn't occur with CBlockIndex
.
Looks like you could either:
- create
interfaces::BlockIndex
- replace
CBlockIndex*
withuint256
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re: #14711 (comment)
Isn't this change conceptually different?
I think so, a height is conceptually different from a block pointer.
Looks like you could either:
When the chain is locked, a height uniquely identifies a block, so many locked_chain
methods take height arguments. I think it would good to eliminate these calls entirely (#10973 (comment)) and not very useful to tweak data types and just hide the fact that the chain is locked.
But either way, I want the API to change in the future and become nicer, more minimal, and more useful over time. Right now the API just reflects how the wallet currently works, to keep changes to wallet code in this PR as minimal as possible.
src/interfaces/chain.h
Outdated
int64_t* max_time = nullptr) = 0; | ||
|
||
//! Estimate fraction of total transactions verified if blocks up to | ||
//! given height are verified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doc-nit: height is not given (at least not directly)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strong Concept ACK |
5cad675
to
591c2c8
Compare
591c2c8
to
939a400
Compare
@ryanofsky I went ahead and split this up into a few commits, found it easier to review. Built and ran tests on each commit. https://github.com/Empact/bitcoin/tree/pr/wchain2 |
src/interfaces/chain.cpp
Outdated
#include <util/system.h> | ||
#include <validation.h> | ||
|
||
#include <memory> | ||
#include <unordered_map> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I believe this belongs in validation.h
, as unordered_map
isn't used directly here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re: #14711 (comment)
nit: I believe this belongs in validation.h, as unordered_map isn't used directly here.
This was added by IWYU because unordered map methods are called here. In theory this allows validation.h
to switch to forward declarations and drop its unordered_map
include without this file having to change. I don't think IWYU rationale is completely airtight (particularly in this case where validation.h
might change mapBlockIndex
into a different type of map with the same methods), but I like the IWYU tool, and don't think its worth spending a lot of time to analyze its decisions absent a compelling reason.
@@ -35,6 +150,34 @@ class ChainImpl : public Chain | |||
return std::move(result); | |||
} | |||
std::unique_ptr<Chain::Lock> assumeLocked() override { return MakeUnique<LockImpl>(); } | |||
bool findBlock(const uint256& hash, CBlock* block, int64_t* time, int64_t* time_max) override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: none of the callers use more than one of the out args, so splitting this up would make the call sites simpler/clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re: #14711 (comment)
nit: none of the callers use more than one of the out args, so splitting this up would make the call sites simpler/clearer.
There are many ways to design this API, and I just opted for one here that I thought would keep chain.h
a little shorter and more organized, at the expense of being more verbose at call sites. If you have a specific alternative in mind and want to convince me or another reviewer that it's better, I'd be happy to adopt it here, or review a followup PR.
src/wallet/rpcwallet.cpp
Outdated
CWallet::ScanResult result = | ||
pwallet->ScanForWalletTransactions(pindexStart, pindexStop, reserver, failed_block, stopBlock, true); | ||
pwallet->ScanForWalletTransactions(start_block, stop_block, reserver, failed_block, stopBlock, true /* prune */); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stop_block
and stopBlock
are confusingly similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Empact! I reset the PR to your branch. Rebased d568bdb -> 5cad675 (pr/wchain2.1 -> pr/wchain2.2) due to conflict with #14380 |
…eAndHeight As suggested in bitcoin#14711, pass height to CChain::FindEarliestAtLeast to simplify Chain interface by combining findFirstBlockWithTime and findFirstBlockWithTimeAndHeight into one Extend findearliestatleast_edge_test in consequence
…stBlockWithTimeAndHeight 765c0b3 refactor: combine Chain::findFirstBlockWithTime/findFirstBlockWithTimeAndHeight (Antoine Riard) Pull request description: As suggested in #14711, pass height to CChain::FindEarliestAtLeast to simplify Chain interface by combining findFirstBlockWithTime and findFirstBlockWithTimeAndHeight into one ACKs for commit 765c0b: jnewbery: utACK 765c0b3. Nice work @ariard! ryanofsky: utACK 765c0b3. Looks good, thanks for implementing the suggestion! Tree-SHA512: 63f98252a93da95f08c0b6325ea98f717aa9ae4036d17eaa6edbec68e5ddd65672d66a6af267b80c36311fffa9b415a47308e95ea7718b300b685e23d4e9e6ec
…eAndHeight As suggested in bitcoin#14711, pass height to CChain::FindEarliestAtLeast to simplify Chain interface by combining findFirstBlockWithTime and findFirstBlockWithTimeAndHeight into one Extend findearliestatleast_edge_test in consequence
Summary: ``` This change removes uses of chainActive and mapBlockIndex globals in wallet code. It is a refactoring change which does not affect external behavior. ``` Backport of core [[bitcoin/bitcoin#14711 | PR14711]]. Test Plan: ninja all check-extended Ran the tests with UBSAN and ASAN as well. Reviewers: #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D5683
Summary: ``` This change removes uses of chainActive and mapBlockIndex globals in wallet code. It is a refactoring change which does not affect external behavior. ``` Backport of core [[bitcoin/bitcoin#14711 | PR14711]]. Test Plan: ninja all check-extended Ran the tests with UBSAN and ASAN as well. Reviewers: #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D5683
…wallet code 44de156 Remove remaining chainActive references from CWallet (Russell Yanofsky) db21f02 Convert CWallet::ScanForWalletTransactions and SyncTransaction to the new Chain apis (Russell Yanofsky) 2ffb079 Add findFork and findBlock to the Chain interface (Russell Yanofsky) d93c4c1 Add time methods to the Chain interface (Russell Yanofsky) 700c42b 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 bitcoin#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 bitcoin#10102. Tree-SHA512: 4dcec8a31c458f54e2ea6ecf01e430469b0994c5b41a21a2d150efa67cd209f4c93ae210a101e064b3a87c52c6edfc70b070e979992be0e3a00fd425de6230a8 # Conflicts: # src/Makefile.am # src/interfaces/wallet.cpp # src/qt/test/wallettests.cpp # src/wallet/rpcdump.cpp # src/wallet/rpcwallet.cpp # src/wallet/test/wallet_tests.cpp # src/wallet/wallet.cpp # src/wallet/wallet.h
aebafd0 Rename Chain getLocator -> getTipLocator (Russell Yanofsky) 2c1fbaa Drop redundant get_value_or (Russell Yanofsky) 84adb20 Fix ScanForWalletTransactions start_block comment (Russell Yanofsky) 2efa66b Document rescanblockchain returned stop_height being null (Russell Yanofsky) db2d093 Add suggested rescanblockchain comments (Russell Yanofsky) a8d645c Update ScanForWalletTransactions result comment (Russell Yanofsky) 95a812b Rename ScanResult stop_block field (Russell Yanofsky) Pull request description: This implements suggested changes from bitcoin#14711 review comments that didn't make make it in before merging. There are no changes in behavior in this PR, just documentation updates, simplifications, and variable renames. Tree-SHA512: 39f1a5718195732b70b5e427c3b3e4295ea5af6328a5991763a422051212dfb95383186db0c0504ce2c2782fb61998dfd2fe9851645b7cb4e75d849049483cc8 # Conflicts: # src/interfaces/chain.cpp # src/qt/test/wallettests.cpp # src/wallet/test/wallet_tests.cpp # src/wallet/wallet.cpp
…wallet code 44de156 Remove remaining chainActive references from CWallet (Russell Yanofsky) db21f02 Convert CWallet::ScanForWalletTransactions and SyncTransaction to the new Chain apis (Russell Yanofsky) 2ffb079 Add findFork and findBlock to the Chain interface (Russell Yanofsky) d93c4c1 Add time methods to the Chain interface (Russell Yanofsky) 700c42b 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 bitcoin#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 bitcoin#10102. Tree-SHA512: 4dcec8a31c458f54e2ea6ecf01e430469b0994c5b41a21a2d150efa67cd209f4c93ae210a101e064b3a87c52c6edfc70b070e979992be0e3a00fd425de6230a8 # Conflicts: # src/Makefile.am # src/interfaces/wallet.cpp # src/qt/test/wallettests.cpp # src/wallet/rpcdump.cpp # src/wallet/rpcwallet.cpp # src/wallet/test/wallet_tests.cpp # src/wallet/wallet.cpp # src/wallet/wallet.h
aebafd0 Rename Chain getLocator -> getTipLocator (Russell Yanofsky) 2c1fbaa Drop redundant get_value_or (Russell Yanofsky) 84adb20 Fix ScanForWalletTransactions start_block comment (Russell Yanofsky) 2efa66b Document rescanblockchain returned stop_height being null (Russell Yanofsky) db2d093 Add suggested rescanblockchain comments (Russell Yanofsky) a8d645c Update ScanForWalletTransactions result comment (Russell Yanofsky) 95a812b Rename ScanResult stop_block field (Russell Yanofsky) Pull request description: This implements suggested changes from bitcoin#14711 review comments that didn't make make it in before merging. There are no changes in behavior in this PR, just documentation updates, simplifications, and variable renames. Tree-SHA512: 39f1a5718195732b70b5e427c3b3e4295ea5af6328a5991763a422051212dfb95383186db0c0504ce2c2782fb61998dfd2fe9851645b7cb4e75d849049483cc8 # Conflicts: # src/interfaces/chain.cpp # src/qt/test/wallettests.cpp # src/wallet/test/wallet_tests.cpp # src/wallet/wallet.cpp
…wallet code 44de156 Remove remaining chainActive references from CWallet (Russell Yanofsky) db21f02 Convert CWallet::ScanForWalletTransactions and SyncTransaction to the new Chain apis (Russell Yanofsky) 2ffb079 Add findFork and findBlock to the Chain interface (Russell Yanofsky) d93c4c1 Add time methods to the Chain interface (Russell Yanofsky) 700c42b 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 bitcoin#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 bitcoin#10102. Tree-SHA512: 4dcec8a31c458f54e2ea6ecf01e430469b0994c5b41a21a2d150efa67cd209f4c93ae210a101e064b3a87c52c6edfc70b070e979992be0e3a00fd425de6230a8 # Conflicts: # src/Makefile.am # src/interfaces/wallet.cpp # src/qt/test/wallettests.cpp # src/wallet/rpcdump.cpp # src/wallet/rpcwallet.cpp # src/wallet/test/wallet_tests.cpp # src/wallet/wallet.cpp # src/wallet/wallet.h
aebafd0 Rename Chain getLocator -> getTipLocator (Russell Yanofsky) 2c1fbaa Drop redundant get_value_or (Russell Yanofsky) 84adb20 Fix ScanForWalletTransactions start_block comment (Russell Yanofsky) 2efa66b Document rescanblockchain returned stop_height being null (Russell Yanofsky) db2d093 Add suggested rescanblockchain comments (Russell Yanofsky) a8d645c Update ScanForWalletTransactions result comment (Russell Yanofsky) 95a812b Rename ScanResult stop_block field (Russell Yanofsky) Pull request description: This implements suggested changes from bitcoin#14711 review comments that didn't make make it in before merging. There are no changes in behavior in this PR, just documentation updates, simplifications, and variable renames. Tree-SHA512: 39f1a5718195732b70b5e427c3b3e4295ea5af6328a5991763a422051212dfb95383186db0c0504ce2c2782fb61998dfd2fe9851645b7cb4e75d849049483cc8 # Conflicts: # src/interfaces/chain.cpp # src/qt/test/wallettests.cpp # src/wallet/test/wallet_tests.cpp # src/wallet/wallet.cpp
…wallet code 44de156 Remove remaining chainActive references from CWallet (Russell Yanofsky) db21f02 Convert CWallet::ScanForWalletTransactions and SyncTransaction to the new Chain apis (Russell Yanofsky) 2ffb079 Add findFork and findBlock to the Chain interface (Russell Yanofsky) d93c4c1 Add time methods to the Chain interface (Russell Yanofsky) 700c42b 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 bitcoin#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 bitcoin#10102. Tree-SHA512: 4dcec8a31c458f54e2ea6ecf01e430469b0994c5b41a21a2d150efa67cd209f4c93ae210a101e064b3a87c52c6edfc70b070e979992be0e3a00fd425de6230a8 # Conflicts: # src/Makefile.am # src/interfaces/wallet.cpp # src/qt/test/wallettests.cpp # src/wallet/rpcdump.cpp # src/wallet/rpcwallet.cpp # src/wallet/test/wallet_tests.cpp # src/wallet/wallet.cpp # src/wallet/wallet.h
aebafd0 Rename Chain getLocator -> getTipLocator (Russell Yanofsky) 2c1fbaa Drop redundant get_value_or (Russell Yanofsky) 84adb20 Fix ScanForWalletTransactions start_block comment (Russell Yanofsky) 2efa66b Document rescanblockchain returned stop_height being null (Russell Yanofsky) db2d093 Add suggested rescanblockchain comments (Russell Yanofsky) a8d645c Update ScanForWalletTransactions result comment (Russell Yanofsky) 95a812b Rename ScanResult stop_block field (Russell Yanofsky) Pull request description: This implements suggested changes from bitcoin#14711 review comments that didn't make make it in before merging. There are no changes in behavior in this PR, just documentation updates, simplifications, and variable renames. Tree-SHA512: 39f1a5718195732b70b5e427c3b3e4295ea5af6328a5991763a422051212dfb95383186db0c0504ce2c2782fb61998dfd2fe9851645b7cb4e75d849049483cc8 # Conflicts: # src/interfaces/chain.cpp # src/qt/test/wallettests.cpp # src/wallet/test/wallet_tests.cpp # src/wallet/wallet.cpp
…wallet code 44de156 Remove remaining chainActive references from CWallet (Russell Yanofsky) db21f02 Convert CWallet::ScanForWalletTransactions and SyncTransaction to the new Chain apis (Russell Yanofsky) 2ffb079 Add findFork and findBlock to the Chain interface (Russell Yanofsky) d93c4c1 Add time methods to the Chain interface (Russell Yanofsky) 700c42b 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 bitcoin#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 bitcoin#10102. Tree-SHA512: 4dcec8a31c458f54e2ea6ecf01e430469b0994c5b41a21a2d150efa67cd209f4c93ae210a101e064b3a87c52c6edfc70b070e979992be0e3a00fd425de6230a8
aebafd0 Rename Chain getLocator -> getTipLocator (Russell Yanofsky) 2c1fbaa Drop redundant get_value_or (Russell Yanofsky) 84adb20 Fix ScanForWalletTransactions start_block comment (Russell Yanofsky) 2efa66b Document rescanblockchain returned stop_height being null (Russell Yanofsky) db2d093 Add suggested rescanblockchain comments (Russell Yanofsky) a8d645c Update ScanForWalletTransactions result comment (Russell Yanofsky) 95a812b Rename ScanResult stop_block field (Russell Yanofsky) Pull request description: This implements suggested changes from bitcoin#14711 review comments that didn't make make it in before merging. There are no changes in behavior in this PR, just documentation updates, simplifications, and variable renames. Tree-SHA512: 39f1a5718195732b70b5e427c3b3e4295ea5af6328a5991763a422051212dfb95383186db0c0504ce2c2782fb61998dfd2fe9851645b7cb4e75d849049483cc8 # Conflicts: # src/interfaces/chain.cpp # src/qt/test/wallettests.cpp # src/wallet/test/wallet_tests.cpp # src/wallet/wallet.cpp
…wallet code 44de156 Remove remaining chainActive references from CWallet (Russell Yanofsky) db21f02 Convert CWallet::ScanForWalletTransactions and SyncTransaction to the new Chain apis (Russell Yanofsky) 2ffb079 Add findFork and findBlock to the Chain interface (Russell Yanofsky) d93c4c1 Add time methods to the Chain interface (Russell Yanofsky) 700c42b 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 bitcoin#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 bitcoin#10102. Tree-SHA512: 4dcec8a31c458f54e2ea6ecf01e430469b0994c5b41a21a2d150efa67cd209f4c93ae210a101e064b3a87c52c6edfc70b070e979992be0e3a00fd425de6230a8
aebafd0 Rename Chain getLocator -> getTipLocator (Russell Yanofsky) 2c1fbaa Drop redundant get_value_or (Russell Yanofsky) 84adb20 Fix ScanForWalletTransactions start_block comment (Russell Yanofsky) 2efa66b Document rescanblockchain returned stop_height being null (Russell Yanofsky) db2d093 Add suggested rescanblockchain comments (Russell Yanofsky) a8d645c Update ScanForWalletTransactions result comment (Russell Yanofsky) 95a812b Rename ScanResult stop_block field (Russell Yanofsky) Pull request description: This implements suggested changes from bitcoin#14711 review comments that didn't make make it in before merging. There are no changes in behavior in this PR, just documentation updates, simplifications, and variable renames. Tree-SHA512: 39f1a5718195732b70b5e427c3b3e4295ea5af6328a5991763a422051212dfb95383186db0c0504ce2c2782fb61998dfd2fe9851645b7cb4e75d849049483cc8 # Conflicts: # src/interfaces/chain.cpp # src/qt/test/wallettests.cpp # src/wallet/test/wallet_tests.cpp # src/wallet/wallet.cpp
…wallet code 44de156 Remove remaining chainActive references from CWallet (Russell Yanofsky) db21f02 Convert CWallet::ScanForWalletTransactions and SyncTransaction to the new Chain apis (Russell Yanofsky) 2ffb079 Add findFork and findBlock to the Chain interface (Russell Yanofsky) d93c4c1 Add time methods to the Chain interface (Russell Yanofsky) 700c42b 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 bitcoin#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 bitcoin#10102. Tree-SHA512: 4dcec8a31c458f54e2ea6ecf01e430469b0994c5b41a21a2d150efa67cd209f4c93ae210a101e064b3a87c52c6edfc70b070e979992be0e3a00fd425de6230a8
aebafd0 Rename Chain getLocator -> getTipLocator (Russell Yanofsky) 2c1fbaa Drop redundant get_value_or (Russell Yanofsky) 84adb20 Fix ScanForWalletTransactions start_block comment (Russell Yanofsky) 2efa66b Document rescanblockchain returned stop_height being null (Russell Yanofsky) db2d093 Add suggested rescanblockchain comments (Russell Yanofsky) a8d645c Update ScanForWalletTransactions result comment (Russell Yanofsky) 95a812b Rename ScanResult stop_block field (Russell Yanofsky) Pull request description: This implements suggested changes from bitcoin#14711 review comments that didn't make make it in before merging. There are no changes in behavior in this PR, just documentation updates, simplifications, and variable renames. Tree-SHA512: 39f1a5718195732b70b5e427c3b3e4295ea5af6328a5991763a422051212dfb95383186db0c0504ce2c2782fb61998dfd2fe9851645b7cb4e75d849049483cc8 # Conflicts: # src/interfaces/chain.cpp # src/qt/test/wallettests.cpp # src/wallet/test/wallet_tests.cpp # src/wallet/wallet.cpp
…wallet code 44de156 Remove remaining chainActive references from CWallet (Russell Yanofsky) db21f02 Convert CWallet::ScanForWalletTransactions and SyncTransaction to the new Chain apis (Russell Yanofsky) 2ffb079 Add findFork and findBlock to the Chain interface (Russell Yanofsky) d93c4c1 Add time methods to the Chain interface (Russell Yanofsky) 700c42b 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 bitcoin#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 bitcoin#10102. Tree-SHA512: 4dcec8a31c458f54e2ea6ecf01e430469b0994c5b41a21a2d150efa67cd209f4c93ae210a101e064b3a87c52c6edfc70b070e979992be0e3a00fd425de6230a8
aebafd0 Rename Chain getLocator -> getTipLocator (Russell Yanofsky) 2c1fbaa Drop redundant get_value_or (Russell Yanofsky) 84adb20 Fix ScanForWalletTransactions start_block comment (Russell Yanofsky) 2efa66b Document rescanblockchain returned stop_height being null (Russell Yanofsky) db2d093 Add suggested rescanblockchain comments (Russell Yanofsky) a8d645c Update ScanForWalletTransactions result comment (Russell Yanofsky) 95a812b Rename ScanResult stop_block field (Russell Yanofsky) Pull request description: This implements suggested changes from bitcoin#14711 review comments that didn't make make it in before merging. There are no changes in behavior in this PR, just documentation updates, simplifications, and variable renames. Tree-SHA512: 39f1a5718195732b70b5e427c3b3e4295ea5af6328a5991763a422051212dfb95383186db0c0504ce2c2782fb61998dfd2fe9851645b7cb4e75d849049483cc8 # Conflicts: # src/interfaces/chain.cpp # src/qt/test/wallettests.cpp # src/wallet/test/wallet_tests.cpp # src/wallet/wallet.cpp
This change removes uses of
chainActive
andmapBlockIndex
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.