mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 23:29:12 +01:00
[net processing] Remove CNode::nServices
Use Peer::m_their_services instead
This commit is contained in:
@@ -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);
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user