[net processing] Add internal _RelayTransactions()

Callers of the external RelayTransactions() no longer need to lock cs_main.
This commit is contained in:
John Newbery
2021-05-01 10:10:54 +01:00
parent b8593616dc
commit 39e19713cd
3 changed files with 14 additions and 11 deletions

View File

@@ -7,7 +7,6 @@
#define BITCOIN_NET_PROCESSING_H
#include <net.h>
#include <sync.h>
#include <validationinterface.h>
class CAddrMan;
@@ -15,8 +14,6 @@ class CChainParams;
class CTxMemPool;
class ChainstateManager;
extern RecursiveMutex cs_main;
/** Default for -maxorphantx, maximum number of orphan transactions kept in memory */
static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 100;
/** Default number of orphan+recently-replaced txn to keep around for block reconstruction */
@@ -49,8 +46,7 @@ public:
virtual bool IgnoresIncomingTxs() = 0;
/** Relay transaction to all peers. */
virtual void RelayTransaction(const uint256& txid, const uint256& wtxid)
EXCLUSIVE_LOCKS_REQUIRED(cs_main) = 0;
virtual void RelayTransaction(const uint256& txid, const uint256& wtxid) = 0;
/** Send ping message to all peers */
virtual void SendPings() = 0;