aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.h
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2021-01-27 22:05:13 +0000
committerJohn Newbery <john@johnnewbery.com>2021-03-04 10:22:42 +0000
commita38a4e8f039dfabfd9435f3a63f1a9b56de086d6 (patch)
tree9f87f4c3a904001bb1b5326b4de3333c78c2c330 /src/net_processing.h
parent92b7efcf54d3154e4b31c9a6eae60f27e349f45e (diff)
downloadbitcoin-a38a4e8f039dfabfd9435f3a63f1a9b56de086d6.tar.xz
[net processing] Move RelayTransaction into PeerManager
We don't mark RelayTransaction as const. Even though it doesn't mutate PeerManagerImpl state, it _is_ mutating the internal state of a CNode object, by updating setInventoryTxToSend. In a subsequent commit, that field will be moved to the Peer object, which is owned by PeerMangerImpl. This requires PeerManagerImpl::ReattemptInitialBroadcast() to no longer be const.
Diffstat (limited to 'src/net_processing.h')
-rw-r--r--src/net_processing.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/net_processing.h b/src/net_processing.h
index 3b09907443..f47594400c 100644
--- a/src/net_processing.h
+++ b/src/net_processing.h
@@ -47,6 +47,10 @@ public:
/** Whether this node ignores txs received over p2p. */
virtual bool IgnoresIncomingTxs() = 0;
+ /** Relay transaction to all peers. */
+ virtual void RelayTransaction(const uint256& txid, const uint256& wtxid, const CConnman& connman)
+ EXCLUSIVE_LOCKS_REQUIRED(cs_main) = 0;
+
/** Send ping message to all peers */
virtual void SendPings() = 0;
@@ -71,7 +75,4 @@ public:
const std::chrono::microseconds time_received, const std::atomic<bool>& interruptMsgProc) = 0;
};
-/** Relay transaction to every node */
-void RelayTransaction(const uint256& txid, const uint256& wtxid, const CConnman& connman) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
-
#endif // BITCOIN_NET_PROCESSING_H