| 507 | } |
| 508 | |
| 509 | bool CConnman::IsBanned(CNetAddr ip) |
| 510 | { |
| 511 | LOCK(cs_setBanned); |
| 512 | for (const auto& it : setBanned) { |
| 513 | CSubNet subNet = it.first; |
| 514 | CBanEntry banEntry = it.second; |
| 515 | |
| 516 | if (subNet.Match(ip) && GetTime() < banEntry.nBanUntil) { |
| 517 | return true; |
| 518 | } |
| 519 | } |
| 520 | return false; |
| 521 | } |
| 522 | |
| 523 | bool CConnman::IsBanned(CSubNet subnet) |
| 524 | { |