| 931 | } |
| 932 | |
| 933 | std::optional<AddressPosition> AddrManImpl::FindAddressEntry_(const CAddress& addr) |
| 934 | { |
| 935 | AssertLockHeld(cs); |
| 936 | |
| 937 | AddrInfo* addr_info = Find(addr); |
| 938 | |
| 939 | if (!addr_info) return std::nullopt; |
| 940 | |
| 941 | if(addr_info->fInTried) { |
| 942 | int bucket{addr_info->GetTriedBucket(nKey, m_asmap)}; |
| 943 | return AddressPosition(/*tried=*/true, |
| 944 | /*multiplicity=*/1, |
| 945 | /*bucket=*/bucket, |
| 946 | /*position=*/addr_info->GetBucketPosition(nKey, false, bucket)); |
| 947 | } else { |
| 948 | int bucket{addr_info->GetNewBucket(nKey, m_asmap)}; |
| 949 | return AddressPosition(/*tried=*/false, |
| 950 | /*multiplicity=*/addr_info->nRefCount, |
| 951 | /*bucket=*/bucket, |
| 952 | /*position=*/addr_info->GetBucketPosition(nKey, true, bucket)); |
| 953 | } |
| 954 | } |
| 955 | |
| 956 | void AddrManImpl::Check() const |
| 957 | { |
nothing calls this directly
no test coverage detected