aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-09-29 18:02:44 +0300
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-10-01 19:00:10 +0300
commit92bd3c1da48d17c8ba20349e18ad19051614bc1a (patch)
tree686b17d2a3b7d8f8ca2af3730edefa0e32bb6f97 /src/net.cpp
parent57f17e57c8c410e10c16a46f7372c0ea8b7dd467 (diff)
downloadbitcoin-92bd3c1da48d17c8ba20349e18ad19051614bc1a.tar.xz
net, refactor: Move AddLocal call one level up
This change simplifies the following commit.
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 856a1b390d..0d906ec573 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;
}