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.
This commit is contained in:
parent
3bf47e73f3
commit
3c327d0d6a
|
@ -658,6 +658,7 @@ void CNode::copyStats(CNodeStats &stats)
|
||||||
X(nRecvBytes);
|
X(nRecvBytes);
|
||||||
}
|
}
|
||||||
X(fWhitelisted);
|
X(fWhitelisted);
|
||||||
|
X(minFeeFilter);
|
||||||
|
|
||||||
// It is common for nodes with good ping times to suddenly become lagged,
|
// It is common for nodes with good ping times to suddenly become lagged,
|
||||||
// due to a new block arriving or other large transfer.
|
// due to a new block arriving or other large transfer.
|
||||||
|
|
|
@ -510,6 +510,7 @@ public:
|
||||||
double dMinPing;
|
double dMinPing;
|
||||||
std::string addrLocal;
|
std::string addrLocal;
|
||||||
CAddress addr;
|
CAddress addr;
|
||||||
|
CAmount minFeeFilter;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include "timedata.h"
|
#include "timedata.h"
|
||||||
#include "ui_interface.h"
|
#include "ui_interface.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
#include "utilmoneystr.h"
|
||||||
#include "utilstrencodings.h"
|
#include "utilstrencodings.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
|
@ -95,6 +96,7 @@ UniValue getpeerinfo(const JSONRPCRequest& request)
|
||||||
" \"inbound\": true|false, (boolean) Inbound (true) or Outbound (false)\n"
|
" \"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"
|
" \"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"
|
" \"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"
|
" \"banscore\": n, (numeric) The ban score\n"
|
||||||
" \"synced_headers\": n, (numeric) The last header we have in common with this peer\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"
|
" \"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("inbound", stats.fInbound));
|
||||||
obj.push_back(Pair("addnode", stats.fAddnode));
|
obj.push_back(Pair("addnode", stats.fAddnode));
|
||||||
obj.push_back(Pair("startingheight", stats.nStartingHeight));
|
obj.push_back(Pair("startingheight", stats.nStartingHeight));
|
||||||
|
obj.push_back(Pair("feefilter", FormatMoney(stats.minFeeFilter)));
|
||||||
if (fStateStats) {
|
if (fStateStats) {
|
||||||
obj.push_back(Pair("banscore", statestats.nMisbehavior));
|
obj.push_back(Pair("banscore", statestats.nMisbehavior));
|
||||||
obj.push_back(Pair("synced_headers", statestats.nSyncHeight));
|
obj.push_back(Pair("synced_headers", statestats.nSyncHeight));
|
||||||
|
|
Loading…
Reference in a new issue