mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
net_processing: Move extra service flag into InitializeNode
This commit is contained in:
parent
9133fd69a5
commit
8e06be347c
2 changed files with 7 additions and 7 deletions
|
|
@ -1790,15 +1790,10 @@ void CConnman::CreateNodeFromAcceptedSocket(std::unique_ptr<Sock>&& sock,
|
|||
NodeId id = GetNewNodeId();
|
||||
uint64_t nonce = GetDeterministicRandomizer(RANDOMIZER_ID_LOCALHOSTNONCE).Write(id).Finalize();
|
||||
|
||||
ServiceFlags nodeServices = nLocalServices;
|
||||
if (NetPermissions::HasFlag(permission_flags, NetPermissionFlags::BloomFilter)) {
|
||||
nodeServices = static_cast<ServiceFlags>(nodeServices | NODE_BLOOM);
|
||||
}
|
||||
|
||||
const bool inbound_onion = std::find(m_onion_binds.begin(), m_onion_binds.end(), addr_bind) != m_onion_binds.end();
|
||||
// The V2Transport transparently falls back to V1 behavior when an incoming V1 connection is
|
||||
// detected, so use it whenever we signal NODE_P2P_V2.
|
||||
const bool use_v2transport(nodeServices & NODE_P2P_V2);
|
||||
const bool use_v2transport(nLocalServices & NODE_P2P_V2);
|
||||
|
||||
CNode* pnode = new CNode(id,
|
||||
std::move(sock),
|
||||
|
|
@ -1816,7 +1811,7 @@ void CConnman::CreateNodeFromAcceptedSocket(std::unique_ptr<Sock>&& sock,
|
|||
.use_v2transport = use_v2transport,
|
||||
});
|
||||
pnode->AddRef();
|
||||
m_msgproc->InitializeNode(*pnode, nodeServices);
|
||||
m_msgproc->InitializeNode(*pnode, nLocalServices);
|
||||
|
||||
LogPrint(BCLog::NET, "connection from %s accepted\n", addr.ToStringAddrPort());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue