mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-21 14:34:49 +01:00
net: get the bind address earlier in CConnman::AcceptConnection()
Call `GetBindAddress()` earlier in `CConnman::AcceptConnection()`. That is specific to the TCP protocol and makes the code below it reusable for other protocols, if the caller provides `addr_bind`, retrieved by other means.
This commit is contained in:
parent
25605895af
commit
1f75a653dd
1 changed files with 2 additions and 1 deletions
|
@ -1020,6 +1020,8 @@ void CConnman::AcceptConnection(const ListenSocket& hListenSocket) {
|
|||
LogPrintf("Warning: Unknown socket family\n");
|
||||
}
|
||||
|
||||
const CAddress addr_bind = GetBindAddress(hSocket);
|
||||
|
||||
NetPermissionFlags permissionFlags = NetPermissionFlags::PF_NONE;
|
||||
hListenSocket.AddSocketPermissionFlags(permissionFlags);
|
||||
AddWhitelistPermissionFlags(permissionFlags, addr);
|
||||
|
@ -1085,7 +1087,6 @@ void CConnman::AcceptConnection(const ListenSocket& hListenSocket) {
|
|||
|
||||
NodeId id = GetNewNodeId();
|
||||
uint64_t nonce = GetDeterministicRandomizer(RANDOMIZER_ID_LOCALHOSTNONCE).Write(id).Finalize();
|
||||
CAddress addr_bind = GetBindAddress(hSocket);
|
||||
|
||||
ServiceFlags nodeServices = nLocalServices;
|
||||
if (NetPermissions::HasFlag(permissionFlags, PF_BLOOMFILTER)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue