[net processing] Remove CNode::nServices

Use Peer::m_their_services instead
This commit is contained in:
John Newbery
2020-07-20 18:46:13 +01:00
committed by dergoegge
parent 7d1c036934
commit d9079fe18d
7 changed files with 13 additions and 12 deletions

View File

@@ -223,9 +223,7 @@ struct Peer {
*
* TODO: remove redundant CNode::nLocalServices*/
const ServiceFlags m_our_services;
/** Services this peer offered to us.
*
* TODO: remove redundant CNode::nServices */
/** Services this peer offered to us. */
std::atomic<ServiceFlags> m_their_services{NODE_NONE};
/** Protects misbehavior data members */
@@ -1472,6 +1470,7 @@ bool PeerManagerImpl::GetNodeStateStats(NodeId nodeid, CNodeStateStats& stats) c
PeerRef peer = GetPeerRef(nodeid);
if (peer == nullptr) return false;
stats.their_services = peer->m_their_services;
stats.m_starting_height = peer->m_starting_height;
// It is common for nodes with good ping times to suddenly become lagged,
// due to a new block arriving or other large transfer.
@@ -2885,7 +2884,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
m_connman.PushMessage(&pfrom, msg_maker.Make(NetMsgType::VERACK));
pfrom.nServices = nServices;
pfrom.m_has_all_wanted_services = HasAllDesirableServiceFlags(nServices);
peer->m_their_services = nServices;
pfrom.SetAddrLocal(addrMe);
{