@@ -273,11 +273,11 @@ void HandleSIGHUP(int)
273273 fReopenDebugLog = true ;
274274}
275275
276- bool static Bind (const CService &addr, unsigned int flags) {
276+ bool static Bind (CConnman& connman, const CService &addr, unsigned int flags) {
277277 if (!(flags & BF_EXPLICIT) && IsLimited (addr))
278278 return false ;
279279 std::string strError;
280- if (!BindListenPort (addr, strError, (flags & BF_WHITELIST) != 0 )) {
280+ if (!connman. BindListenPort (addr, strError, (flags & BF_WHITELIST) != 0 )) {
281281 if (flags & BF_REPORT_ERROR)
282282 return InitError (strError);
283283 return false ;
@@ -1198,22 +1198,22 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
11981198 CService addrBind;
11991199 if (!Lookup (strBind.c_str (), addrBind, GetListenPort (), false ))
12001200 return InitError (ResolveErrMsg (" bind" , strBind));
1201- fBound |= Bind (addrBind, (BF_EXPLICIT | BF_REPORT_ERROR));
1201+ fBound |= Bind (connman, addrBind, (BF_EXPLICIT | BF_REPORT_ERROR));
12021202 }
12031203 BOOST_FOREACH (const std::string& strBind, mapMultiArgs[" -whitebind" ]) {
12041204 CService addrBind;
12051205 if (!Lookup (strBind.c_str (), addrBind, 0 , false ))
12061206 return InitError (ResolveErrMsg (" whitebind" , strBind));
12071207 if (addrBind.GetPort () == 0 )
12081208 return InitError (strprintf (_ (" Need to specify a port with -whitebind: '%s'" ), strBind));
1209- fBound |= Bind (addrBind, (BF_EXPLICIT | BF_REPORT_ERROR | BF_WHITELIST));
1209+ fBound |= Bind (connman, addrBind, (BF_EXPLICIT | BF_REPORT_ERROR | BF_WHITELIST));
12101210 }
12111211 }
12121212 else {
12131213 struct in_addr inaddr_any;
12141214 inaddr_any.s_addr = INADDR_ANY;
1215- fBound |= Bind (CService (in6addr_any, GetListenPort ()), BF_NONE);
1216- fBound |= Bind (CService (inaddr_any, GetListenPort ()), !fBound ? BF_REPORT_ERROR : BF_NONE);
1215+ fBound |= Bind (connman, CService (in6addr_any, GetListenPort ()), BF_NONE);
1216+ fBound |= Bind (connman, CService (inaddr_any, GetListenPort ()), !fBound ? BF_REPORT_ERROR : BF_NONE);
12171217 }
12181218 if (!fBound )
12191219 return InitError (_ (" Failed to listen on any port. Use -listen=0 if you want this." ));
0 commit comments