mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 15:04:44 +01:00
style: wrap long lines in CNode creation and add some comments
This commit is contained in:
parent
b683491648
commit
ef5014d256
1 changed files with 20 additions and 2 deletions
22
src/net.cpp
22
src/net.cpp
|
@ -505,7 +505,16 @@ CNode* CConnman::ConnectNode(CAddress addrConnect, const char *pszDest, bool fCo
|
||||||
if (!addr_bind.IsValid()) {
|
if (!addr_bind.IsValid()) {
|
||||||
addr_bind = GetBindAddress(sock->Get());
|
addr_bind = GetBindAddress(sock->Get());
|
||||||
}
|
}
|
||||||
CNode* pnode = new CNode(id, nLocalServices, std::move(sock), addrConnect, CalculateKeyedNetGroup(addrConnect), nonce, addr_bind, pszDest ? pszDest : "", conn_type, /* inbound_onion */ false);
|
CNode* pnode = new CNode(id,
|
||||||
|
nLocalServices,
|
||||||
|
std::move(sock),
|
||||||
|
addrConnect,
|
||||||
|
CalculateKeyedNetGroup(addrConnect),
|
||||||
|
nonce,
|
||||||
|
addr_bind,
|
||||||
|
pszDest ? pszDest : "",
|
||||||
|
conn_type,
|
||||||
|
/*inbound_onion=*/false);
|
||||||
pnode->AddRef();
|
pnode->AddRef();
|
||||||
|
|
||||||
// We're making a new connection, harvest entropy from the time (and our peer count)
|
// We're making a new connection, harvest entropy from the time (and our peer count)
|
||||||
|
@ -1197,7 +1206,16 @@ void CConnman::CreateNodeFromAcceptedSocket(std::unique_ptr<Sock>&& sock,
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool inbound_onion = std::find(m_onion_binds.begin(), m_onion_binds.end(), addr_bind) != m_onion_binds.end();
|
const bool inbound_onion = std::find(m_onion_binds.begin(), m_onion_binds.end(), addr_bind) != m_onion_binds.end();
|
||||||
CNode* pnode = new CNode(id, nodeServices, std::move(sock), addr, CalculateKeyedNetGroup(addr), nonce, addr_bind, "", ConnectionType::INBOUND, inbound_onion);
|
CNode* pnode = new CNode(id,
|
||||||
|
nodeServices,
|
||||||
|
std::move(sock),
|
||||||
|
addr,
|
||||||
|
CalculateKeyedNetGroup(addr),
|
||||||
|
nonce,
|
||||||
|
addr_bind,
|
||||||
|
/*addrNameIn=*/"",
|
||||||
|
ConnectionType::INBOUND,
|
||||||
|
inbound_onion);
|
||||||
pnode->AddRef();
|
pnode->AddRef();
|
||||||
pnode->m_permissionFlags = permissionFlags;
|
pnode->m_permissionFlags = permissionFlags;
|
||||||
pnode->m_prefer_evict = discouraged;
|
pnode->m_prefer_evict = discouraged;
|
||||||
|
|
Loading…
Add table
Reference in a new issue