mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
[refactor] Change tx_relay structure to be unique_ptr
This commit is contained in:
12
src/net.h
12
src/net.h
@@ -733,7 +733,7 @@ public:
|
||||
int64_t nextSendTimeFeeFilter{0};
|
||||
};
|
||||
|
||||
TxRelay m_tx_relay;
|
||||
std::unique_ptr<TxRelay> m_tx_relay;
|
||||
// Used for headers announcements - unfiltered blocks to relay
|
||||
std::vector<uint256> vBlockHashesToAnnounce GUARDED_BY(cs_inventory);
|
||||
|
||||
@@ -849,17 +849,17 @@ public:
|
||||
void AddInventoryKnown(const CInv& inv)
|
||||
{
|
||||
{
|
||||
LOCK(m_tx_relay.cs_tx_inventory);
|
||||
m_tx_relay.filterInventoryKnown.insert(inv.hash);
|
||||
LOCK(m_tx_relay->cs_tx_inventory);
|
||||
m_tx_relay->filterInventoryKnown.insert(inv.hash);
|
||||
}
|
||||
}
|
||||
|
||||
void PushInventory(const CInv& inv)
|
||||
{
|
||||
if (inv.type == MSG_TX) {
|
||||
LOCK(m_tx_relay.cs_tx_inventory);
|
||||
if (!m_tx_relay.filterInventoryKnown.contains(inv.hash)) {
|
||||
m_tx_relay.setInventoryTxToSend.insert(inv.hash);
|
||||
LOCK(m_tx_relay->cs_tx_inventory);
|
||||
if (!m_tx_relay->filterInventoryKnown.contains(inv.hash)) {
|
||||
m_tx_relay->setInventoryTxToSend.insert(inv.hash);
|
||||
}
|
||||
} else if (inv.type == MSG_BLOCK) {
|
||||
LOCK(cs_inventory);
|
||||
|
||||
Reference in New Issue
Block a user