| 3479 | } |
| 3480 | |
| 3481 | bool 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 | |
| 3500 | bool CConnman::InitBinds(const Options& options) |
| 3501 | { |
no test coverage detected