diff --git a/src/net.h b/src/net.h --- a/src/net.h +++ b/src/net.h @@ -564,6 +564,7 @@ double dPingTime; double dPingWait; double dMinPing; + Amount minFeeFilter; // Our address, as reported by the peer std::string addrLocal; // Address of this peer diff --git a/src/net.cpp b/src/net.cpp --- a/src/net.cpp +++ b/src/net.cpp @@ -728,6 +728,7 @@ stats.nRecvBytes = nRecvBytes; } stats.fWhitelisted = fWhitelisted; + stats.minFeeFilter = minFeeFilter; // It is common for nodes with good ping times to suddenly become lagged, // due to a new block arriving or other large transfer. Merely reporting diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -132,6 +132,8 @@ " ],\n" " \"whitelisted\": true|false, (boolean) Whether the peer is " "whitelisted\n" + " \"minfeefilter\": n, (numeric) The minimum fee rate " + "for transactions this peer accepts\n" " \"bytessent_per_msg\": {\n" " \"addr\": n, (numeric) The total bytes sent " "aggregated by message type\n" @@ -210,6 +212,7 @@ obj.pushKV("inflight", heights); } obj.pushKV("whitelisted", stats.fWhitelisted); + obj.pushKV("minfeefilter", ValueFromAmount(stats.minFeeFilter)); UniValue sendPerMsgCmd(UniValue::VOBJ); for (const mapMsgCmdSize::value_type &i : stats.mapSendBytesPerMsgCmd) { diff --git a/test/functional/rpc_net.py b/test/functional/rpc_net.py --- a/test/functional/rpc_net.py +++ b/test/functional/rpc_net.py @@ -7,6 +7,8 @@ Tests correspond to code in rpc/net.cpp. """ +from decimal import Decimal + from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( assert_equal, @@ -21,6 +23,8 @@ def set_test_params(self): self.setup_clean_chain = True self.num_nodes = 2 + self.extra_args = [["-minrelaytxfee=0.00001000"], + ["-minrelaytxfee=0.00000500"]] def run_test(self): self._test_connection_count() @@ -93,6 +97,8 @@ # the address bound to on one side will be the source address for the other node assert_equal(peer_info[0][0]['addrbind'], peer_info[1][0]['addr']) assert_equal(peer_info[1][0]['addrbind'], peer_info[0][0]['addr']) + assert_equal(peer_info[0][0]['minfeefilter'], Decimal("0.00000500")) + assert_equal(peer_info[1][0]['minfeefilter'], Decimal("0.00001000")) if __name__ == '__main__':