Skip to content

Commit 92bd3c1

Browse files
committed
net, refactor: Move AddLocal call one level up
This change simplifies the following commit.
1 parent 57f17e5 commit 92bd3c1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/net.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2211,10 +2211,6 @@ bool CConnman::BindListenPort(const CService& addrBind, bilingual_str& strError,
22112211
}
22122212

22132213
vhListenSocket.push_back(ListenSocket(hListenSocket, permissions));
2214-
2215-
if (addrBind.IsRoutable() && fDiscover && (permissions & PF_NOBAN) == 0)
2216-
AddLocal(addrBind, LOCAL_BIND);
2217-
22182214
return true;
22192215
}
22202216

@@ -2308,6 +2304,11 @@ bool CConnman::Bind(const CService &addr, unsigned int flags, NetPermissionFlags
23082304
}
23092305
return false;
23102306
}
2307+
2308+
if (addr.IsRoutable() && fDiscover && (permissions & PF_NOBAN) == 0) {
2309+
AddLocal(addr, LOCAL_BIND);
2310+
}
2311+
23112312
return true;
23122313
}
23132314

0 commit comments

Comments
 (0)