aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorSuhas Daftuar <sdaftuar@gmail.com>2019-03-08 14:26:36 -0500
committerSuhas Daftuar <sdaftuar@gmail.com>2019-08-28 13:41:58 -0400
commit4de0dbac9b286c42a9b10132b7c2d76712f1a319 (patch)
tree028412f5e563bf5ab01a689a1ba78057b015198f /src/net.cpp
parent26a93bce29fd813e1402b013f402869c25b656d1 (diff)
downloadbitcoin-4de0dbac9b286c42a9b10132b7c2d76712f1a319.tar.xz
[refactor] Move tx relay state to separate structure
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 0464a6e9ea..527c001308 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -500,8 +500,8 @@ void CNode::copyStats(CNodeStats &stats)
X(addr);
X(addrBind);
{
- LOCK(cs_filter);
- X(fRelayTxes);
+ LOCK(m_tx_relay.cs_filter);
+ stats.fRelayTxes = m_tx_relay.fRelayTxes;
}
X(nLastSend);
X(nLastRecv);
@@ -529,8 +529,8 @@ void CNode::copyStats(CNodeStats &stats)
X(m_legacyWhitelisted);
X(m_permissionFlags);
{
- LOCK(cs_feeFilter);
- X(minFeeFilter);
+ LOCK(m_tx_relay.cs_feeFilter);
+ stats.minFeeFilter = m_tx_relay.minFeeFilter;
}
// It is common for nodes with good ping times to suddenly become lagged,
@@ -818,11 +818,11 @@ bool CConnman::AttemptToEvictConnection()
continue;
if (node->fDisconnect)
continue;
- LOCK(node->cs_filter);
+ LOCK(node->m_tx_relay.cs_filter);
NodeEvictionCandidate candidate = {node->GetId(), node->nTimeConnected, node->nMinPingUsecTime,
node->nLastBlockTime, node->nLastTXTime,
HasAllDesirableServiceFlags(node->nServices),
- node->fRelayTxes, node->pfilter != nullptr, node->addr, node->nKeyedNetGroup,
+ node->m_tx_relay.fRelayTxes, node->m_tx_relay.pfilter != nullptr, node->addr, node->nKeyedNetGroup,
node->m_prefer_evict};
vEvictionCandidates.push_back(candidate);
}
@@ -2625,7 +2625,6 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn
fInbound(fInboundIn),
nKeyedNetGroup(nKeyedNetGroupIn),
addrKnown(5000, 0.001),
- filterInventoryKnown(50000, 0.000001),
id(idIn),
nLocalHostNonce(nLocalHostNonceIn),
nLocalServices(nLocalServicesIn),
@@ -2634,8 +2633,6 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn
hSocket = hSocketIn;
addrName = addrNameIn == "" ? addr.ToStringIPPort() : addrNameIn;
hashContinue = uint256();
- filterInventoryKnown.reset();
- pfilter = MakeUnique<CBloomFilter>();
for (const std::string &msg : getAllNetMessageTypes())
mapRecvBytesPerMsgCmd[msg] = 0;