aboutsummaryrefslogtreecommitdiff
path: root/src/interface
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2017-04-17 16:02:44 -0400
committerJohn Newbery <john@johnnewbery.com>2018-04-04 16:52:40 -0400
commit3034a462a5d30144cf0ec801d07f0c8c36d560f3 (patch)
tree13e518ccabc2cb1e91aaab1d7edbe0d814f510ec /src/interface
parente0b66a3b7c5d3a079636d61fcf611bb6b36c7bc1 (diff)
downloadbitcoin-3034a462a5d30144cf0ec801d07f0c8c36d560f3.tar.xz
Remove direct bitcoin calls from qt/bantablemodel.cpp
Diffstat (limited to 'src/interface')
-rw-r--r--src/interface/node.cpp9
-rw-r--r--src/interface/node.h4
2 files changed, 13 insertions, 0 deletions
diff --git a/src/interface/node.cpp b/src/interface/node.cpp
index 1937fe9d9b..740878b675 100644
--- a/src/interface/node.cpp
+++ b/src/interface/node.cpp
@@ -4,6 +4,7 @@
#include <interface/node.h>
+#include <addrdb.h>
#include <chain.h>
#include <chainparams.h>
#include <init.h>
@@ -105,6 +106,14 @@ class NodeImpl : public Node
}
return false;
}
+ bool getBanned(banmap_t& banmap) override
+ {
+ if (g_connman) {
+ g_connman->GetBanned(banmap);
+ return true;
+ }
+ return false;
+ }
int64_t getTotalBytesRecv() override { return g_connman ? g_connman->GetTotalBytesRecv() : 0; }
int64_t getTotalBytesSent() override { return g_connman ? g_connman->GetTotalBytesSent() : 0; }
size_t getMempoolSize() override { return ::mempool.size(); }
diff --git a/src/interface/node.h b/src/interface/node.h
index 6288487032..880232d9e7 100644
--- a/src/interface/node.h
+++ b/src/interface/node.h
@@ -5,6 +5,7 @@
#ifndef BITCOIN_INTERFACE_NODE_H
#define BITCOIN_INTERFACE_NODE_H
+#include <addrdb.h> // For banmap_t
#include <init.h> // For HelpMessageMode
#include <net.h> // For CConnman::NumConnections
#include <netaddress.h> // For Network
@@ -87,6 +88,9 @@ public:
using NodesStats = std::vector<std::tuple<CNodeStats, bool, CNodeStateStats>>;
virtual bool getNodesStats(NodesStats& stats) = 0;
+ //! Get ban map entries.
+ virtual bool getBanned(banmap_t& banmap) = 0;
+
//! Get total bytes recv.
virtual int64_t getTotalBytesRecv() = 0;