diff options
| author | Ross Nicoll <[email protected]> | 2021-06-03 12:15:24 +0100 |
|---|---|---|
| committer | Ross Nicoll <[email protected]> | 2021-06-09 08:14:36 +0100 |
| commit | 39a231053a94afaaca140d3ec8ad795f37accfc1 (patch) | |
| tree | 49b70fcca7eed9ff05e6b65db091129a1c7e332f /src/interfaces | |
| parent | Merge pull request #2252 from rnicoll/1.21-auxpow-parameters (diff) | |
| download | discoin-39a231053a94afaaca140d3ec8ad795f37accfc1.tar.xz discoin-39a231053a94afaaca140d3ec8ad795f37accfc1.zip | |
Add node context to wallet RPC request object
Add node context to wallet RPC request object, as getauxblock needs access to the node to determine if it is in initial block download, and requires access to the wallet to get an address to pay to.
Diffstat (limited to 'src/interfaces')
| -rw-r--r-- | src/interfaces/wallet.cpp | 8 | ||||
| -rw-r--r-- | src/interfaces/wallet.h | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/interfaces/wallet.cpp b/src/interfaces/wallet.cpp index f68016b55..599b265ba 100644 --- a/src/interfaces/wallet.cpp +++ b/src/interfaces/wallet.cpp @@ -7,6 +7,7 @@ #include <amount.h> #include <interfaces/chain.h> #include <interfaces/handler.h> +#include <node/context.h> #include <policy/fees.h> #include <primitives/transaction.h> #include <rpc/server.h> @@ -489,8 +490,9 @@ public: class WalletClientImpl : public WalletClient { public: - WalletClientImpl(Chain& chain, ArgsManager& args) + WalletClientImpl(NodeContext& node, Chain& chain, ArgsManager& args) { + m_context.nodeContext = &node; m_context.chain = &chain; m_context.args = &args; } @@ -566,9 +568,9 @@ public: std::unique_ptr<Wallet> MakeWallet(const std::shared_ptr<CWallet>& wallet) { return wallet ? MakeUnique<WalletImpl>(wallet) : nullptr; } -std::unique_ptr<WalletClient> MakeWalletClient(Chain& chain, ArgsManager& args) +std::unique_ptr<WalletClient> MakeWalletClient(NodeContext& node, Chain& chain, ArgsManager& args) { - return MakeUnique<WalletClientImpl>(chain, args); + return MakeUnique<WalletClientImpl>(node, chain, args); } } // namespace interfaces diff --git a/src/interfaces/wallet.h b/src/interfaces/wallet.h index 6ccfd7fc2..be1a3572c 100644 --- a/src/interfaces/wallet.h +++ b/src/interfaces/wallet.h @@ -411,7 +411,7 @@ std::unique_ptr<Wallet> MakeWallet(const std::shared_ptr<CWallet>& wallet); //! Return implementation of ChainClient interface for a wallet client. This //! function will be undefined in builds where ENABLE_WALLET is false. -std::unique_ptr<WalletClient> MakeWalletClient(Chain& chain, ArgsManager& args); +std::unique_ptr<WalletClient> MakeWalletClient(NodeContext& node, Chain& chain, ArgsManager& args); } // namespace interfaces |