aboutsummaryrefslogtreecommitdiff
path: root/src/interface/node.cpp
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2017-04-17 18:56:44 -0400
committerJohn Newbery <john@johnnewbery.com>2018-04-04 16:52:40 -0400
commita0704a8996bb950ae3c4d5b5a30e9dfe34cde1d3 (patch)
treed7dc5b382640f965bdff98baa1aa4e21a7af5d20 /src/interface/node.cpp
parent90d4640b7eff3154a0750c5acb52d39bd41e0bbb (diff)
Remove most direct bitcoin calls from qt/walletmodel.cpp
Diffstat (limited to 'src/interface/node.cpp')
-rw-r--r--src/interface/node.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/interface/node.cpp b/src/interface/node.cpp
index 2f0114f5e4..db03cc0627 100644
--- a/src/interface/node.cpp
+++ b/src/interface/node.cpp
@@ -5,6 +5,7 @@
#include <interface/node.h>
#include <addrdb.h>
+#include <amount.h>
#include <chain.h>
#include <chainparams.h>
#include <init.h>
@@ -28,6 +29,7 @@
#include <config/bitcoin-config.h>
#endif
#ifdef ENABLE_WALLET
+#include <wallet/wallet.h>
#define CHECK_WALLET(x) x
#else
#define CHECK_WALLET(x) throw std::logic_error("Wallet function called in non-wallet build.")
@@ -37,8 +39,6 @@
#include <boost/thread/thread.hpp>
#include <univalue.h>
-class CWallet;
-
namespace interface {
namespace {
@@ -185,6 +185,8 @@ class NodeImpl : public Node
}
}
bool getNetworkActive() override { return g_connman && g_connman->GetNetworkActive(); }
+ unsigned int getTxConfirmTarget() override { CHECK_WALLET(return ::nTxConfirmTarget); }
+ CAmount getMaxTxFee() override { return ::maxTxFee; }
UniValue executeRpc(const std::string& command, const UniValue& params, const std::string& uri) override
{
JSONRPCRequest req;
@@ -196,6 +198,18 @@ class NodeImpl : public Node
std::vector<std::string> listRpcCommands() override { return ::tableRPC.listCommands(); }
void rpcSetTimerInterfaceIfUnset(RPCTimerInterface* iface) override { RPCSetTimerInterfaceIfUnset(iface); }
void rpcUnsetTimerInterface(RPCTimerInterface* iface) override { RPCUnsetTimerInterface(iface); }
+ std::vector<std::unique_ptr<Wallet>> getWallets() override
+ {
+#ifdef ENABLE_WALLET
+ std::vector<std::unique_ptr<Wallet>> wallets;
+ for (CWalletRef wallet : ::vpwallets) {
+ wallets.emplace_back(MakeWallet(*wallet));
+ }
+ return wallets;
+#else
+ throw std::logic_error("Node::getWallets() called in non-wallet build.");
+#endif
+ }
std::unique_ptr<Handler> handleInitMessage(InitMessageFn fn) override
{
return MakeHandler(::uiInterface.InitMessage.connect(fn));