mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
[net processing] Remove CNode::nServices
Use Peer::m_their_services instead
This commit is contained in:
parent
7d1c036934
commit
d9079fe18d
7 changed files with 13 additions and 12 deletions
|
|
@ -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);
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue