[net processing] Add IgnoresIncomingTxs() function to PeerManager
This commit is contained in:
1 parent
5805b8299f
commit
f3f61d0eb9
2 files changed
+6
-1
No files matched your search
@@ -138,6 +138,9 @@ public:
|
|||||||
/** Get statistics from node state */
|
/** Get statistics from node state */
|
||||||
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats& stats);
|
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats& stats);
|
||||||
|
|
||||||
|
/** Whether this node ignores txs received over p2p. */
|
||||||
|
bool IgnoresIncomingTxs() {return !::g_relay_txes;};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** Get a shared pointer to the Peer object.
|
/** Get a shared pointer to the Peer object.
|
||||||
* May return an empty shared_ptr if the Peer object can't be found. */
|
* May return an empty shared_ptr if the Peer object can't be found. */
|
||||||
|
|||||||
+3
-1
@@ -578,7 +578,9 @@ static RPCHelpMan getnetworkinfo()
|
|||||||
obj.pushKV("localservices", strprintf("%016x", services));
|
obj.pushKV("localservices", strprintf("%016x", services));
|
||||||
obj.pushKV("localservicesnames", GetServicesNames(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());
|
obj.pushKV("timeoffset", GetTimeOffset());
|
||||||
if (node.connman) {
|
if (node.connman) {
|
||||||
obj.pushKV("networkactive", node.connman->GetNetworkActive());
|
obj.pushKV("networkactive", node.connman->GetNetworkActive());
|
||||||
|
|||||||
Reference in new issue
Block a user