From 58845587e11140e81f087a74c3db76a4d1fc3a1a Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Tue, 18 Apr 2017 16:42:30 -0400 Subject: Remove direct bitcoin calls from qt transaction table files --- src/interface/node.cpp | 6 ++ src/interface/node.h | 7 ++ src/interface/wallet.cpp | 138 ++++++++++++++++++++++++++++++++++++ src/interface/wallet.h | 69 ++++++++++++++++++ src/qt/bitcoin.cpp | 4 +- src/qt/recentrequeststablemodel.cpp | 3 +- src/qt/recentrequeststablemodel.h | 4 +- src/qt/test/wallettests.cpp | 2 +- src/qt/transactiondesc.cpp | 138 ++++++++++++++++++++---------------- src/qt/transactiondesc.h | 12 ++-- src/qt/transactionrecord.cpp | 86 ++++++++++------------ src/qt/transactionrecord.h | 16 +++-- src/qt/transactiontablemodel.cpp | 100 ++++++++++---------------- src/qt/transactiontablemodel.h | 13 ++-- src/qt/walletmodel.cpp | 19 ++--- src/qt/walletmodel.h | 3 +- 16 files changed, 410 insertions(+), 210 deletions(-) (limited to 'src') diff --git a/src/interface/node.cpp b/src/interface/node.cpp index 0e6bc4a785..a8ed275dc5 100644 --- a/src/interface/node.cpp +++ b/src/interface/node.cpp @@ -60,6 +60,7 @@ class NodeImpl : public Node void initLogging() override { InitLogging(); } void initParameterInteraction() override { InitParameterInteraction(); } std::string getWarnings(const std::string& type) override { return GetWarnings(type); } + uint32_t getLogCategories() override { return ::logCategories; } bool baseInitialize() override { return AppInitBasicSetup() && AppInitParameterInteraction() && AppInitSanityChecks() && @@ -227,6 +228,11 @@ class NodeImpl : public Node std::vector listRpcCommands() override { return ::tableRPC.listCommands(); } void rpcSetTimerInterfaceIfUnset(RPCTimerInterface* iface) override { RPCSetTimerInterfaceIfUnset(iface); } void rpcUnsetTimerInterface(RPCTimerInterface* iface) override { RPCUnsetTimerInterface(iface); } + bool getUnspentOutput(const COutPoint& output, Coin& coin) override + { + LOCK(::cs_main); + return ::pcoinsTip->GetCoin(output, coin); + } std::vector> getWallets() override { #ifdef ENABLE_WALLET diff --git a/src/interface/node.h b/src/interface/node.h index a31105f6f8..c73f45a1b0 100644 --- a/src/interface/node.h +++ b/src/interface/node.h @@ -22,6 +22,7 @@ class CCoinControl; class CFeeRate; class CNodeStats; +class Coin; class RPCTimerInterface; class UniValue; class proxyType; @@ -66,6 +67,9 @@ public: //! Get warnings. virtual std::string getWarnings(const std::string& type) = 0; + // Get log flags. + virtual uint32_t getLogCategories() = 0; + //! Initialize app dependencies. virtual bool baseInitialize() = 0; @@ -184,6 +188,9 @@ public: //! Unset RPC timer interface. virtual void rpcUnsetTimerInterface(RPCTimerInterface* iface) = 0; + //! Get unspent outputs associated with a transaction. + virtual bool getUnspentOutput(const COutPoint& output, Coin& coin) = 0; + //! Return interfaces for accessing wallets (if any). virtual std::vector> getWallets() = 0; diff --git a/src/interface/wallet.cpp b/src/interface/wallet.cpp index efc9946fb6..a6bce7d3de 100644 --- a/src/interface/wallet.cpp +++ b/src/interface/wallet.cpp @@ -15,6 +15,7 @@ #include