From 92bd3c1da48d17c8ba20349e18ad19051614bc1a Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Tue, 29 Sep 2020 18:02:44 +0300 Subject: [PATCH] net, refactor: Move AddLocal call one level up This change simplifies the following commit. --- src/net.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index 856a1b390..0d906ec57 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2211,10 +2211,6 @@ bool CConnman::BindListenPort(const CService& addrBind, bilingual_str& strError, } vhListenSocket.push_back(ListenSocket(hListenSocket, permissions)); - - if (addrBind.IsRoutable() && fDiscover && (permissions & PF_NOBAN) == 0) - AddLocal(addrBind, LOCAL_BIND); - return true; } @@ -2308,6 +2304,11 @@ bool CConnman::Bind(const CService &addr, unsigned int flags, NetPermissionFlags } return false; } + + if (addr.IsRoutable() && fDiscover && (permissions & PF_NOBAN) == 0) { + AddLocal(addr, LOCAL_BIND); + } + return true; }