-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Remove wallet -> node global function calls #15288
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
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. |
Agree with @hebasto that the indentations should be fixed since those are misaligned by this PR. Not sure about fixing
I'll wait for Russ's response to the style comments before doing a full review. |
Will look more closely but probably I'll fix whitespace in the existing commits and add braces in a new commit. |
Obvious Concept ACK |
src/interfaces/chain.cpp
Outdated
@@ -25,6 +26,8 @@ | |||
#include <memory> | |||
#include <utility> | |||
|
|||
class CReserveScript; |
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.
unnecessary given this is declared in the header
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.
unnecessary given this is declared in the header
This was added by IWYU because CReserveScript
is only forward declared in the headers included here, and defined in a different header. In theory this allows the other headers to change without breaking this file. I don't think IWYU rationale is completely airtight, but I like the IWYU tool, and don't personally think it's worth spending effort to override it if it isn't creating a problem.
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.
Aside: Perhaps IWYU can be included in doc/developer-notes.md
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.
Agree, and it should come with steps to install for Bitcoin Core.
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.
Agree, and it should come with steps to install for Bitcoin Core.
It's not very convenient, but here are steps I've followed previously: #11878 (comment)
@@ -5,7 +5,8 @@ | |||
#ifndef BITCOIN_INTERFACES_CHAIN_H | |||
#define BITCOIN_INTERFACES_CHAIN_H | |||
|
|||
#include <optional.h> | |||
#include <optional.h> // For Optional and 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.
nit: IMO we could do without this comment
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: IMO we could do without this comment
Not clear what change is being asked for. It would seem inconsistent to delete this comment and keep other comments around it.
@@ -138,6 +139,9 @@ class Chain | |||
|
|||
//! Get virtual transaction size. | |||
virtual int64_t getVirtualTransactionSize(const CTransaction& tx) = 0; | |||
|
|||
//! Check if transaction is RBF opt in. | |||
virtual RBFTransactionState isRBFOptIn(const CTransaction& tx) = 0; |
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 return the status string and thus avoid the include / simplify the interface.
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 return the status string and thus avoid the include / simplify the interface.
Include could be removed with a forward declaration in the future. String would make the interface more cumbersome and generate JSONRPC error text in non-RPC code.
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.
Call me enum
fanboy, but I like to avoid using strings when enums suffice, and let the RPC & GUI deal with rendering them as strings. So agree with keeping it as is.
src/Makefile.bench.include
Outdated
@@ -43,6 +43,10 @@ bench_bench_bitcoin_LDADD = \ | |||
$(LIBBITCOIN_UTIL) \ | |||
$(LIBBITCOIN_CONSENSUS) \ | |||
$(LIBBITCOIN_CRYPTO) \ | |||
$(LIBBITCOIN_WALLET) \ | |||
$(LIBBITCOIN_SERVER) \ | |||
$(EVENT_PTHREADS_LIBS) \ |
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 you explain these? Compiles successfully with just the EVENT_LIBS on my machine.
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 you explain these? Compiles successfully with just the EVENT_LIBS on my machine.
I didn't take the time go back and see why these were needed, but I dropped the wallet and server lines. We have circular dependencies so the need to repeat libraries on the linker command line comes and goes as dependencies between individual object files change: #14437 (comment)
@@ -99,8 +99,6 @@ class CCoinControl; | |||
class COutput; | |||
class CReserveKey; | |||
class CScript; | |||
class CTxMemPool; | |||
class CBlockPolicyEstimator; |
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.
note: last use removed in d97fe20
@@ -258,6 +259,7 @@ class ChainImpl : public Chain | |||
void initMessage(const std::string& message) override { ::uiInterface.InitMessage(message); } | |||
void initWarning(const std::string& message) override { InitWarning(message); } | |||
void initError(const std::string& message) override { InitError(message); } | |||
void loadWallet(std::unique_ptr<Wallet> wallet) override { ::uiInterface.LoadWallet(wallet); } |
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.
Should this be in interfaces/node
? That's where other ::uiInterface
access is.
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.
Should this be in interfaces/node? That's where other ::uiInterface access is.
Previous comment #15288 (comment) about uiInterface
also applies here, but in the future, the initMessage
, initWarning
, initError
, and loadWallet
methods will likely move to a new interface (maybe interfaces::WalletClient
or interfaces::Ui
) to allow the bitcoin-gui
process to connect directly to the bitcoin-wallet
process without going through bitcoin-node
.
I didn't start down that road yet because ostensibly there are a lot of other ways the Chain object could be broken up, and in general I think it's less confusing to have fewer class types with more methods than more class types with fewer methods. Especially if instances would have the same cardinality and just be sitting side by side anyway.
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 for the explanation.
the
initMessage
,initWarning
,initError
, andloadWallet
methods will likely move to a new interface
I though it could be interfaces::Wallet
, the CreateWalletFromFile
caller would get the wallet interface asap, then request the loading etc and then signal the loading for everyone else.
@@ -251,6 +252,9 @@ class ChainImpl : public Chain | |||
bool getPruneMode() override { return ::fPruneMode; } | |||
bool p2pEnabled() override { return g_connman != nullptr; } | |||
int64_t getAdjustedTime() override { return GetAdjustedTime(); } | |||
void initMessage(const std::string& message) override { ::uiInterface.InitMessage(message); } | |||
void initWarning(const std::string& message) override { InitWarning(message); } | |||
void initError(const std::string& message) override { InitError(message); } |
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.
Should this be in interfaces/node
? That's where other ::uiInterface
access is.
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.
Should this be in interfaces/node? That's where other ::uiInterface access is.
In #10102 there are three processes: bitcoin-node
, bitcoin-wallet
, and bitcoin-gui
. interfaces::Node
is used by the bitcoin-gui
process to control the bitcoin-node
process, and interfaces::Chain
is used by the bitcoin-wallet
process to interact with the bitcoin-node
process (mainly by receiving blocks and transactions).
The uiInterface
variable is used in both NodeImpl
and ChainImpl
classes because they both execute in the same bitcoin-node
process where uiInterface
is valid.
Concept ACK |
Concept ACK. |
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 ba426f5. This is a great tidyup.
There are lots of commits This could be split into smaller PRs, but they're all very straightforward changes so I think it's fine to keep as one PR.
I have a few questions and suggested changes inline but none should hold up merge.
Very tidy work Russ. Thanks for your persistence with this!
src/interfaces/chain.h
Outdated
virtual bool checkFinalTx(const CTransaction& tx) = 0; | ||
|
||
//! Add transaction to memory pool. | ||
virtual bool acceptToMemoryPool(CTransactionRef tx, CValidationState& state) = 0; |
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.
Suggestion: consider renaming this interface function submitToMemoryPool()
. The wallet cannot itself accept a transaction to the memory pool, it can only submit it to the node, which will decide whether to accept the tx. I think changing the naming reinforces the division between wallet and node.
Interested to hear your thoughts on this. If you agree, we can push the naming change to a future PR.
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: #15288 (comment)
Suggestion: consider renaming this interface function
submitToMemoryPool()
Makes sense, changed.
src/interfaces/chain.cpp
Outdated
{ | ||
LockAnnotation lock(::cs_main); | ||
return AcceptToMemoryPool(::mempool, state, tx, nullptr /* missing inputs */, nullptr /* txn replaced */, | ||
false /* bypass limits */, ::maxTxFee /* absurd fee */); |
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.
I have a slight concern about the maxTxFee
being set by the node instead of the wallet here, but that's more of a long-term design question (and is inherited from having a single maxTxFee
for both the raw transaction RPCs and wallet RPCs). This PR simply moves the existing function calls to the interface classes. The API can be improved later.
Longer term, the single -maxtxfee
option should not be shared between the node and wallet. See #15355 for more details.
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: #15288 (comment)
I replaced ::maxTxFee with an absurd_fee parameter here to help with goal of having separate settings. I think this also makes the current behavior more clear.
src/interfaces/chain.cpp
Outdated
} | ||
bool relayTransaction(const uint256& txid) override | ||
{ | ||
if (g_connman) { |
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.
Are we ever expecting g_conman
to be false? (except perhaps in the unit tests?)
In any case, you could make this a bit tidier with:
if (g_conman == nullptr) return false
...
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: https://github.com/bitcoin/bitcoin/pull/15288/files#r254417716
In commit "Remove use of g_connman / PushInventory in wallet code" (9cd8d6a)
Are we ever expecting
g_conman
to be false? (except perhaps in the unit tests?)
I don't think so, but it does seem reasonable for a test to leave g_connman set to null.
This is just a cut and paste of the previous code, so that's where the check comes from.
In any case, you could make this a bit tidier
Applied suggestion
src/wallet/wallet.cpp
Outdated
{ | ||
pnode->PushInventory(inv); | ||
}); | ||
if (pwallet->chain().relayTransaction(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.
could just:
return pwallet->chain().relayTransaction(GetHash())
here
EDIT: in fact, after ff0c6da, you could just change the conditional above to:
if (InMempool() || AcceptToMemoryPool(locked_chain, state) && pwallet->chain().p2pEnabled()) {
pwallet->chain().relayTransaction(GetHash());
}
and drop the return value from relayTransaction()
(which doesn't get called anywhere else)
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: #15288 (comment)
could just
Nice suggestions, they do make things clearer and I think I applied them all.
src/interfaces/chain.cpp
Outdated
auto nLimitAncestorSize = gArgs.GetArg("-limitancestorsize", DEFAULT_ANCESTOR_SIZE_LIMIT) * 1000; | ||
auto nLimitDescendants = gArgs.GetArg("-limitdescendantcount", DEFAULT_DESCENDANT_LIMIT); | ||
auto nLimitDescendantSize = gArgs.GetArg("-limitdescendantsize", DEFAULT_DESCENDANT_SIZE_LIMIT) * 1000; | ||
std::string errString; |
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.
The return value of errString
is unused. A future PR could rename to dummy_string
or add a comment. Not required for this move-only commit.
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: #15288 (comment)
The return value of
errString
is unused. A future PR could rename todummy_string
or add a comment. Not required for this move-only commit.
Applied suggestion here. This wasn't 100% move only anyway, because size_t/auto change (I think made in response to practicalswift signed/unsigned warnings).
src/rpc/mining.h
Outdated
@@ -13,6 +13,6 @@ | |||
UniValue generateBlocks(std::shared_ptr<CReserveScript> coinbaseScript, int nGenerate, uint64_t nMaxTries, bool keepScript); | |||
|
|||
/** Check bounds on a command line confirm target */ | |||
unsigned int ParseConfirmTarget(const UniValue& value); | |||
unsigned int ParseConfirmTarget(const UniValue& value, unsigned int max_target); |
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.
Wow. This should be moved into rpc/util
(in a future PR). (also comment is outdated!)
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.
Wow. This should be moved into
rpc/util
(in a future PR). (also comment is outdated!)
Done in #15373.
src/interfaces/chain.cpp
Outdated
{ | ||
return ::feeEstimator.HighestTargetTracked(FeeEstimateHorizon::LONG_HALFLIFE); | ||
} | ||
CFeeRate poolMinFee() 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: can you name this function mempoolMinFee()
?
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.
src/interfaces/chain.h
Outdated
//! Send init error. | ||
virtual void initError(const std::string& message) = 0; | ||
|
||
//! Send wallet load notification. |
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: change to "Send wallet load notification to the GUI."
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.
@@ -270,7 +270,7 @@ class NodeImpl : public Node | |||
} | |||
std::unique_ptr<Handler> handleLoadWallet(LoadWalletFn fn) override | |||
{ | |||
return MakeHandler(::uiInterface.LoadWallet_connect([fn](std::shared_ptr<CWallet> wallet) { fn(MakeWallet(wallet)); })); | |||
return MakeHandler(::uiInterface.LoadWallet_connect([fn](std::unique_ptr<Wallet>& wallet) { fn(std::move(wallet)); })); |
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.
It's not obvious to me why this (and associated changes) is necessary. Can you perhaps add commentary to the commit message why you're changing the function signature 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: #15288 (comment)
It's not obvious to me why this (and associated changes) is necessary
I'll add information to the commit message, but just to give some feedback now, the idea is that in #10102 the CWallet
class is internal to the bitcoin-wallet
process. The other bitcoin-node
and bitcoin-gui
processes don't use CWallet
at all, and only access the wallet through interface classes (interfaces::ChainClient
and interfaces::Wallet
respectively).
The change from shared_ptr
to unique_ptr
here just follows because CWallet
is used with shared_ptr
, while the interface classes have more defined lifetimes and don't need shared_ptr
. Any place an interface argument or return value is passed it's always by reference or with unique_ptr
.
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: #15288 (comment)
Can you perhaps add commentary to the commit message why you're changing the function signature here?
Added description in f40de05
Concept ACK |
Util is a better home since it's called both by wallet and mining code. Suggested bitcoin#15288 (comment)
50e6472 Move ParseConfirmTarget from rpc/mining to rpc/util (Russell Yanofsky) Pull request description: Util is a better home since it's called both by wallet and mining code. Suggested bitcoin#15288 (comment) Tree-SHA512: 4320caf2a3f70d2885c421de04f2ec68ff3f6519258c5155fc46e245dc1765fd15c81f260af5096318f24ff9deb88fc3c5ef40eec8b7393f467f5b963d17215b
50e6472 Move ParseConfirmTarget from rpc/mining to rpc/util (Russell Yanofsky) Pull request description: Util is a better home since it's called both by wallet and mining code. Suggested bitcoin#15288 (comment) Tree-SHA512: 4320caf2a3f70d2885c421de04f2ec68ff3f6519258c5155fc46e245dc1765fd15c81f260af5096318f24ff9deb88fc3c5ef40eec8b7393f467f5b963d17215b
50e6472 Move ParseConfirmTarget from rpc/mining to rpc/util (Russell Yanofsky) Pull request description: Util is a better home since it's called both by wallet and mining code. Suggested bitcoin#15288 (comment) Tree-SHA512: 4320caf2a3f70d2885c421de04f2ec68ff3f6519258c5155fc46e245dc1765fd15c81f260af5096318f24ff9deb88fc3c5ef40eec8b7393f467f5b963d17215b
50e6472 Move ParseConfirmTarget from rpc/mining to rpc/util (Russell Yanofsky) Pull request description: Util is a better home since it's called both by wallet and mining code. Suggested bitcoin#15288 (comment) Tree-SHA512: 4320caf2a3f70d2885c421de04f2ec68ff3f6519258c5155fc46e245dc1765fd15c81f260af5096318f24ff9deb88fc3c5ef40eec8b7393f467f5b963d17215b
7a9046e [wallet] Refactor CWalletTx::RelayWalletTransaction() (John Newbery) Pull request description: Refactor `CWalletTx::RelayWalletTransaction()` function. This was a suggestion from the wallet-node separation PR: bitcoin#15288 (comment), which we deferred until after the main PR was merged. There are also makes two minor behavior changes: - no longer assert if fBroadcastTransactions is false. Just return false from the function. - no longer print the relay message if p2pEnabled is set to false (since the transaction is not actually relayed). ACKs for commit 7a9046: promag: utACK 7a9046e. MeshCollider: utACK bitcoin@7a9046e ryanofsky: utACK 7a9046e. No changes at all, just rebase after base PR bitcoin#15632 was merged Tree-SHA512: 2ae6214cfadd917a1b3a892c4277e5e57c3eb791e17f67511470e6fbc634d19356554b9f9c55af6b779fdef821914aad59b7cc9e6c13ece145df003bf507d486
7a9046e [wallet] Refactor CWalletTx::RelayWalletTransaction() (John Newbery) Pull request description: Refactor `CWalletTx::RelayWalletTransaction()` function. This was a suggestion from the wallet-node separation PR: bitcoin#15288 (comment), which we deferred until after the main PR was merged. There are also makes two minor behavior changes: - no longer assert if fBroadcastTransactions is false. Just return false from the function. - no longer print the relay message if p2pEnabled is set to false (since the transaction is not actually relayed). ACKs for commit 7a9046: promag: utACK 7a9046e. MeshCollider: utACK bitcoin@7a9046e ryanofsky: utACK 7a9046e. No changes at all, just rebase after base PR bitcoin#15632 was merged Tree-SHA512: 2ae6214cfadd917a1b3a892c4277e5e57c3eb791e17f67511470e6fbc634d19356554b9f9c55af6b779fdef821914aad59b7cc9e6c13ece145df003bf507d486
merge bitcoin#10973, bitcoin#15039, bitcoin#15288: separate wallet from node
…n#15288 4d4e4c6 Suggested interfaces::Chain cleanups from bitcoin#15288 (Russell Yanofsky) Pull request description: Mostly documentation improvements requested in the last review of bitcoin#15288 before it was merged (bitcoin#15288 (review)) Tree-SHA512: 64e912520bbec20a44032f265a8cf3f11ad7f5126c8626b5ad5e888227b1f92ecb321522fab4bbbd613230b55450abd6ace023631d0a4f357a780d65c5638bfe
…n#15288 4d4e4c6 Suggested interfaces::Chain cleanups from bitcoin#15288 (Russell Yanofsky) Pull request description: Mostly documentation improvements requested in the last review of bitcoin#15288 before it was merged (bitcoin#15288 (review)) Tree-SHA512: 64e912520bbec20a44032f265a8cf3f11ad7f5126c8626b5ad5e888227b1f92ecb321522fab4bbbd613230b55450abd6ace023631d0a4f357a780d65c5638bfe
7a9046e [wallet] Refactor CWalletTx::RelayWalletTransaction() (John Newbery) Pull request description: Refactor `CWalletTx::RelayWalletTransaction()` function. This was a suggestion from the wallet-node separation PR: bitcoin#15288 (comment), which we deferred until after the main PR was merged. There are also makes two minor behavior changes: - no longer assert if fBroadcastTransactions is false. Just return false from the function. - no longer print the relay message if p2pEnabled is set to false (since the transaction is not actually relayed). ACKs for commit 7a9046: promag: utACK 7a9046e. MeshCollider: utACK bitcoin@7a9046e ryanofsky: utACK 7a9046e. No changes at all, just rebase after base PR bitcoin#15632 was merged Tree-SHA512: 2ae6214cfadd917a1b3a892c4277e5e57c3eb791e17f67511470e6fbc634d19356554b9f9c55af6b779fdef821914aad59b7cc9e6c13ece145df003bf507d486
7a9046e [wallet] Refactor CWalletTx::RelayWalletTransaction() (John Newbery) Pull request description: Refactor `CWalletTx::RelayWalletTransaction()` function. This was a suggestion from the wallet-node separation PR: bitcoin#15288 (comment), which we deferred until after the main PR was merged. There are also makes two minor behavior changes: - no longer assert if fBroadcastTransactions is false. Just return false from the function. - no longer print the relay message if p2pEnabled is set to false (since the transaction is not actually relayed). ACKs for commit 7a9046: promag: utACK 7a9046e. MeshCollider: utACK bitcoin@7a9046e ryanofsky: utACK 7a9046e. No changes at all, just rebase after base PR bitcoin#15632 was merged Tree-SHA512: 2ae6214cfadd917a1b3a892c4277e5e57c3eb791e17f67511470e6fbc634d19356554b9f9c55af6b779fdef821914aad59b7cc9e6c13ece145df003bf507d486
7a9046e [wallet] Refactor CWalletTx::RelayWalletTransaction() (John Newbery) Pull request description: Refactor `CWalletTx::RelayWalletTransaction()` function. This was a suggestion from the wallet-node separation PR: bitcoin#15288 (comment), which we deferred until after the main PR was merged. There are also makes two minor behavior changes: - no longer assert if fBroadcastTransactions is false. Just return false from the function. - no longer print the relay message if p2pEnabled is set to false (since the transaction is not actually relayed). ACKs for commit 7a9046: promag: utACK 7a9046e. MeshCollider: utACK bitcoin@7a9046e ryanofsky: utACK 7a9046e. No changes at all, just rebase after base PR bitcoin#15632 was merged Tree-SHA512: 2ae6214cfadd917a1b3a892c4277e5e57c3eb791e17f67511470e6fbc634d19356554b9f9c55af6b779fdef821914aad59b7cc9e6c13ece145df003bf507d486
50e6472 Move ParseConfirmTarget from rpc/mining to rpc/util (Russell Yanofsky) Pull request description: Util is a better home since it's called both by wallet and mining code. Suggested bitcoin#15288 (comment) Tree-SHA512: 4320caf2a3f70d2885c421de04f2ec68ff3f6519258c5155fc46e245dc1765fd15c81f260af5096318f24ff9deb88fc3c5ef40eec8b7393f467f5b963d17215b
This change removes wallet calls to node functions that access global chain and mempool state.
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.