MCPcopy Create free account
hub / github.com/ElementsProject/elements / Bind

Method Bind

src/net.cpp:2543–2563  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2541
2542
2543bool CConnman::Bind(const CService& addr_, unsigned int flags, NetPermissionFlags permissions)
2544{
2545 const CService addr{MaybeFlipIPv6toCJDNS(addr_)};
2546
2547 if (!(flags & BF_EXPLICIT) && !IsReachable(addr)) {
2548 return false;
2549 }
2550 bilingual_str strError;
2551 if (!BindListenPort(addr, strError, permissions)) {
2552 if ((flags & BF_REPORT_ERROR) && m_client_interface) {
2553 m_client_interface->ThreadSafeMessageBox(strError, "", CClientUIInterface::MSG_ERROR);
2554 }
2555 return false;
2556 }
2557
2558 if (addr.IsRoutable() && fDiscover && !(flags & BF_DONT_ADVERTISE) && !NetPermissions::HasFlag(permissions, NetPermissionFlags::NoBan)) {
2559 AddLocal(addr, LOCAL_BIND);
2560 }
2561
2562 return true;
2563}
2564
2565bool CConnman::InitBinds(const Options& options)
2566{

Callers

nothing calls this directly

Calls 5

MaybeFlipIPv6toCJDNSFunction · 0.85
IsReachableFunction · 0.85
AddLocalFunction · 0.85
ThreadSafeMessageBoxMethod · 0.80
IsRoutableMethod · 0.80

Tested by

no test coverage detected