| 578 | } |
| 579 | |
| 580 | void CConnman::AddWhitelistPermissionFlags(NetPermissionFlags& flags, std::optional<CNetAddr> addr, const std::vector<NetWhitelistPermissions>& ranges) const { |
| 581 | for (const auto& subnet : ranges) { |
| 582 | if (addr.has_value() && subnet.m_subnet.Match(addr.value())) { |
| 583 | NetPermissions::AddFlag(flags, subnet.m_flags); |
| 584 | } |
| 585 | } |
| 586 | if (NetPermissions::HasFlag(flags, NetPermissionFlags::Implicit)) { |
| 587 | NetPermissions::ClearFlag(flags, NetPermissionFlags::Implicit); |
| 588 | if (whitelist_forcerelay) NetPermissions::AddFlag(flags, NetPermissionFlags::ForceRelay); |
| 589 | if (whitelist_relay) NetPermissions::AddFlag(flags, NetPermissionFlags::Relay); |
| 590 | NetPermissions::AddFlag(flags, NetPermissionFlags::Mempool); |
| 591 | NetPermissions::AddFlag(flags, NetPermissionFlags::NoBan); |
| 592 | } |
| 593 | } |
| 594 | |
| 595 | CService CNode::GetAddrLocal() const |
| 596 | { |