aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorSuhas Daftuar <sdaftuar@gmail.com>2019-03-08 15:30:36 -0500
committerSuhas Daftuar <sdaftuar@gmail.com>2019-08-28 13:41:58 -0400
commitc4aa2ba82211ea5988ed7fe21e1b08bc3367e6d4 (patch)
treef0666a205ae658352be324c48aac5507110c7ab6 /src/net.h
parent4de0dbac9b286c42a9b10132b7c2d76712f1a319 (diff)
[refactor] Change tx_relay structure to be unique_ptr
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/net.h b/src/net.h
index bd46d995ec..d12fc3ae9a 100644
--- a/src/net.h
+++ b/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);