MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / Bind

Method Bind

src/net.cpp:3481–3498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3479}
3480
3481bool CConnman::Bind(const CService& addr_, unsigned int flags, NetPermissionFlags permissions)
3482{
3483 const CService addr{MaybeFlipIPv6toCJDNS(addr_)};
3484
3485 bilingual_str strError;
3486 if (!BindListenPort(addr, strError, permissions)) {
3487 if ((flags & BF_REPORT_ERROR) && m_client_interface) {
3488 m_client_interface->ThreadSafeMessageBox(strError, CClientUIInterface::MSG_ERROR);
3489 }
3490 return false;
3491 }
3492
3493 if (addr.IsRoutable() && fDiscover && !(flags & BF_DONT_ADVERTISE) && !NetPermissions::HasFlag(permissions, NetPermissionFlags::NoBan)) {
3494 AddLocal(addr, LOCAL_BIND);
3495 }
3496
3497 return true;
3498}
3499
3500bool CConnman::InitBinds(const Options& options)
3501{

Callers 2

BindAndStartListeningMethod · 0.45
BindListenPortMethod · 0.45

Calls 3

MaybeFlipIPv6toCJDNSFunction · 0.85
AddLocalFunction · 0.85
IsRoutableMethod · 0.80

Tested by

no test coverage detected