aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Lodder <[email protected]>2021-08-14 00:34:54 +0200
committerPatrick Lodder <[email protected]>2021-08-14 03:16:54 +0200
commit3c327d0d6a4b1d1a684860ee7b29da31486e96dd (patch)
tree71900340a260c24c009412cfd476dfcc2d35ccab
parentMerge pull request #2437 from michilumin/1.14.4-mintxfee (diff)
downloaddiscoin-3c327d0d6a4b1d1a684860ee7b29da31486e96dd.tar.xz
discoin-3c327d0d6a4b1d1a684860ee7b29da31486e96dd.zip
rpc: add feefilter to peers from getpeerinfo
Exposes information about the feefilter the peer sets to us, so that we can make better informed decisions when a transaction does not get relayed.
-rw-r--r--src/net.cpp1
-rw-r--r--src/net.h1
-rw-r--r--src/rpc/net.cpp3
3 files changed, 5 insertions, 0 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 2117c59fd..64e8eaad6 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -658,6 +658,7 @@ void CNode::copyStats(CNodeStats &stats)
X(nRecvBytes);
}
X(fWhitelisted);
+ X(minFeeFilter);
// It is common for nodes with good ping times to suddenly become lagged,
// due to a new block arriving or other large transfer.
diff --git a/src/net.h b/src/net.h
index f5841a314..bbde0e336 100644
--- a/src/net.h
+++ b/src/net.h
@@ -510,6 +510,7 @@ public:
double dMinPing;
std::string addrLocal;
CAddress addr;
+ CAmount minFeeFilter;
};
diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp
index e1400914f..d092d47d4 100644
--- a/src/rpc/net.cpp
+++ b/src/rpc/net.cpp
@@ -16,6 +16,7 @@
#include "timedata.h"
#include "ui_interface.h"
#include "util.h"
+#include "utilmoneystr.h"
#include "utilstrencodings.h"
#include "version.h"
@@ -95,6 +96,7 @@ UniValue getpeerinfo(const JSONRPCRequest& request)
" \"inbound\": true|false, (boolean) Inbound (true) or Outbound (false)\n"
" \"addnode\": true|false, (boolean) Whether connection was due to addnode and is using an addnode slot\n"
" \"startingheight\": n, (numeric) The starting height (block) of the peer\n"
+ " \"feefilter\": \"decimal\", (string) The value of the last feefilter set by this peer, in DOGE\n"
" \"banscore\": n, (numeric) The ban score\n"
" \"synced_headers\": n, (numeric) The last header we have in common with this peer\n"
" \"synced_blocks\": n, (numeric) The last block we have in common with this peer\n"
@@ -157,6 +159,7 @@ UniValue getpeerinfo(const JSONRPCRequest& request)
obj.push_back(Pair("inbound", stats.fInbound));
obj.push_back(Pair("addnode", stats.fAddnode));
obj.push_back(Pair("startingheight", stats.nStartingHeight));
+ obj.push_back(Pair("feefilter", FormatMoney(stats.minFeeFilter)));
if (fStateStats) {
obj.push_back(Pair("banscore", statestats.nMisbehavior));
obj.push_back(Pair("synced_headers", statestats.nSyncHeight));