| 2541 | |
| 2542 | |
| 2543 | bool 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 | |
| 2565 | bool CConnman::InitBinds(const Options& options) |
| 2566 | { |
nothing calls this directly
no test coverage detected