Code clean up. Remove use of X macro.

This commit is contained in:
Simon
2018-03-05 15:00:33 -08:00
parent 796ea3815e
commit 7e9d662ef6

View File

@@ -535,24 +535,22 @@ void CNode::AddWhitelistedRange(const CSubNet &subnet) {
vWhitelistedRange.push_back(subnet); vWhitelistedRange.push_back(subnet);
} }
#undef X
#define X(name) stats.name = name
void CNode::copyStats(CNodeStats &stats) void CNode::copyStats(CNodeStats &stats)
{ {
stats.nodeid = this->GetId(); stats.nodeid = this->GetId();
X(nServices); stats.nServices = nServices;
X(nLastSend); stats.nLastSend = nLastSend;
X(nLastRecv); stats.nLastRecv = nLastRecv;
X(nTimeConnected); stats.nTimeConnected = nTimeConnected;
X(nTimeOffset); stats.nTimeOffset = nTimeOffset;
X(addrName); stats.addrName = addrName;
X(nVersion); stats.nVersion = nVersion;
X(cleanSubVer); stats.cleanSubVer = cleanSubVer;
X(fInbound); stats.fInbound = fInbound;
X(nStartingHeight); stats.nStartingHeight = nStartingHeight;
X(nSendBytes); stats.nSendBytes = nSendBytes;
X(nRecvBytes); stats.nRecvBytes = nRecvBytes;
X(fWhitelisted); stats.fWhitelisted = fWhitelisted;
// It is common for nodes with good ping times to suddenly become lagged, // It is common for nodes with good ping times to suddenly become lagged,
// due to a new block arriving or other large transfer. // due to a new block arriving or other large transfer.
@@ -572,7 +570,6 @@ void CNode::copyStats(CNodeStats &stats)
// Leave string empty if addrLocal invalid (not filled in yet) // Leave string empty if addrLocal invalid (not filled in yet)
stats.addrLocal = addrLocal.IsValid() ? addrLocal.ToString() : ""; stats.addrLocal = addrLocal.IsValid() ? addrLocal.ToString() : "";
} }
#undef X
// requires LOCK(cs_vRecvMsg) // requires LOCK(cs_vRecvMsg)
bool CNode::ReceiveMsgBytes(const char *pch, unsigned int nBytes) bool CNode::ReceiveMsgBytes(const char *pch, unsigned int nBytes)