Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/node.cpp
Show All 10 Lines | |||||
#include <config.h> | #include <config.h> | ||||
#include <init.h> | #include <init.h> | ||||
#include <interfaces/handler.h> | #include <interfaces/handler.h> | ||||
#include <interfaces/wallet.h> | #include <interfaces/wallet.h> | ||||
#include <net.h> | #include <net.h> | ||||
#include <net_processing.h> | #include <net_processing.h> | ||||
#include <netaddress.h> | #include <netaddress.h> | ||||
#include <netbase.h> | #include <netbase.h> | ||||
#include <policy/fees.h> | |||||
#include <policy/policy.h> | |||||
#include <primitives/block.h> | #include <primitives/block.h> | ||||
#include <rpc/server.h> | #include <rpc/server.h> | ||||
#include <scheduler.h> | #include <scheduler.h> | ||||
#include <sync.h> | #include <sync.h> | ||||
#include <txmempool.h> | #include <txmempool.h> | ||||
#include <ui_interface.h> | #include <ui_interface.h> | ||||
#include <util.h> | #include <util.h> | ||||
#include <validation.h> | #include <validation.h> | ||||
#include <warnings.h> | #include <warnings.h> | ||||
#if defined(HAVE_CONFIG_H) | #if defined(HAVE_CONFIG_H) | ||||
#include <config/bitcoin-config.h> | #include <config/bitcoin-config.h> | ||||
#endif | #endif | ||||
#ifdef ENABLE_WALLET | #ifdef ENABLE_WALLET | ||||
#include <wallet/fees.h> | |||||
#include <wallet/wallet.h> | #include <wallet/wallet.h> | ||||
#define CHECK_WALLET(x) x | #define CHECK_WALLET(x) x | ||||
#else | #else | ||||
#define CHECK_WALLET(x) \ | #define CHECK_WALLET(x) \ | ||||
throw std::logic_error("Wallet function called in non-wallet build.") | throw std::logic_error("Wallet function called in non-wallet build.") | ||||
#endif | #endif | ||||
#include <boost/thread/thread.hpp> | #include <boost/thread/thread.hpp> | ||||
▲ Show 20 Lines • Show All 162 Lines • ▼ Show 20 Lines | class NodeImpl : public Node { | ||||
void setNetworkActive(bool active) override { | void setNetworkActive(bool active) override { | ||||
if (g_connman) { | if (g_connman) { | ||||
g_connman->SetNetworkActive(active); | g_connman->SetNetworkActive(active); | ||||
} | } | ||||
} | } | ||||
bool getNetworkActive() override { | bool getNetworkActive() override { | ||||
return g_connman && g_connman->GetNetworkActive(); | return g_connman && g_connman->GetNetworkActive(); | ||||
} | } | ||||
Amount getMinimumFee(unsigned int tx_bytes, | |||||
const CCoinControl &coin_control) override { | |||||
Amount result; | |||||
CHECK_WALLET(result = | |||||
GetMinimumFee(tx_bytes, g_mempool, coin_control)); | |||||
return result; | |||||
} | |||||
Amount getMaxTxFee() override { return ::maxTxFee; } | Amount getMaxTxFee() override { return ::maxTxFee; } | ||||
CFeeRate getDustRelayFee() override { return ::dustRelayFee; } | |||||
CFeeRate getPayTxFee() override { CHECK_WALLET(return ::payTxFee); } | |||||
UniValue executeRpc(Config &config, const std::string &command, | UniValue executeRpc(Config &config, const std::string &command, | ||||
const UniValue ¶ms, | const UniValue ¶ms, | ||||
const std::string &uri) override { | const std::string &uri) override { | ||||
JSONRPCRequest req; | JSONRPCRequest req; | ||||
req.params = params; | req.params = params; | ||||
req.strMethod = command; | req.strMethod = command; | ||||
req.URI = uri; | req.URI = uri; | ||||
return ::tableRPC.execute(config, req); | return ::tableRPC.execute(config, req); | ||||
▲ Show 20 Lines • Show All 82 Lines • Show Last 20 Lines |