[net processing] Add IgnoresIncomingTxs() function to PeerManager

pull/20217/head
John Newbery 4 years ago
parent 5805b8299f
commit f3f61d0eb9

@ -138,6 +138,9 @@ public:
/** Get statistics from node state */
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats& stats);
/** Whether this node ignores txs received over p2p. */
bool IgnoresIncomingTxs() {return !::g_relay_txes;};
private:
/** Get a shared pointer to the Peer object.
* May return an empty shared_ptr if the Peer object can't be found. */

@ -578,7 +578,9 @@ static RPCHelpMan getnetworkinfo()
obj.pushKV("localservices", strprintf("%016x", services));
obj.pushKV("localservicesnames", GetServicesNames(services));
}
obj.pushKV("localrelay", g_relay_txes);
if (node.peerman) {
obj.pushKV("localrelay", !node.peerman->IgnoresIncomingTxs());
}
obj.pushKV("timeoffset", GetTimeOffset());
if (node.connman) {
obj.pushKV("networkactive", node.connman->GetNetworkActive());

Loading…
Cancel
Save