mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-26 11:13:23 -03:00
[net processing] Add IgnoresIncomingTxs() function to PeerManager
This commit is contained in:
parent
5805b8299f
commit
f3f61d0eb9
2 changed files with 6 additions and 1 deletions
|
@ -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. */
|
||||||
|
|
|
@ -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());
|
||||||
|
|
Loading…
Add table
Reference in a new issue