diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-05-23 19:40:21 +0300 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-06-14 17:28:37 +0300 |
commit | f79a664314b88941c1a2796623e846d0a5916c06 (patch) | |
tree | 82f1ba8a72eca87980ff6cf28e6ff6768e18e1ac /src/addrman.h | |
parent | 187b7d2bb36e6de9cd960378021ebe690619a2ef (diff) |
refactor: Apply consistent pattern for CAddrMan::Check usage
Co-authored-by: John Newbery <john@johnnewbery.com>
Diffstat (limited to 'src/addrman.h')
-rw-r--r-- | src/addrman.h | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/addrman.h b/src/addrman.h index 3474153e36..2250d1a14c 100644 --- a/src/addrman.h +++ b/src/addrman.h @@ -551,13 +551,10 @@ public: //! Randomly select an address in tried that another address is attempting to evict. CAddrInfo SelectTriedCollision() { - CAddrInfo ret; - { - LOCK(cs); - Check(); - ret = SelectTriedCollision_(); - Check(); - } + LOCK(cs); + Check(); + const CAddrInfo ret = SelectTriedCollision_(); + Check(); return ret; } @@ -566,13 +563,10 @@ public: */ CAddrInfo Select(bool newOnly = false) { - CAddrInfo addrRet; - { - LOCK(cs); - Check(); - addrRet = Select_(newOnly); - Check(); - } + LOCK(cs); + Check(); + const CAddrInfo addrRet = Select_(newOnly); + Check(); return addrRet; } |