From 7e9d662ef6aa260019242b5a869fdfd1a28f9bc8 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 5 Mar 2018 15:00:33 -0800 Subject: [PATCH] Code clean up. Remove use of X macro. --- src/net.cpp | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index f2f231b9f..961db1ff8 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -535,24 +535,22 @@ void CNode::AddWhitelistedRange(const CSubNet &subnet) { vWhitelistedRange.push_back(subnet); } -#undef X -#define X(name) stats.name = name void CNode::copyStats(CNodeStats &stats) { stats.nodeid = this->GetId(); - X(nServices); - X(nLastSend); - X(nLastRecv); - X(nTimeConnected); - X(nTimeOffset); - X(addrName); - X(nVersion); - X(cleanSubVer); - X(fInbound); - X(nStartingHeight); - X(nSendBytes); - X(nRecvBytes); - X(fWhitelisted); + stats.nServices = nServices; + stats.nLastSend = nLastSend; + stats.nLastRecv = nLastRecv; + stats.nTimeConnected = nTimeConnected; + stats.nTimeOffset = nTimeOffset; + stats.addrName = addrName; + stats.nVersion = nVersion; + stats.cleanSubVer = cleanSubVer; + stats.fInbound = fInbound; + stats.nStartingHeight = nStartingHeight; + stats.nSendBytes = nSendBytes; + stats.nRecvBytes = nRecvBytes; + stats.fWhitelisted = fWhitelisted; // It is common for nodes with good ping times to suddenly become lagged, // 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) stats.addrLocal = addrLocal.IsValid() ? addrLocal.ToString() : ""; } -#undef X // requires LOCK(cs_vRecvMsg) bool CNode::ReceiveMsgBytes(const char *pch, unsigned int nBytes)