diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-08-18 09:07:18 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-09-21 10:07:38 +0200 |
commit | fae5c633dc05a045aaac370b383e4799cb0e0590 (patch) | |
tree | f165c299d76113d6742f31f0f1c02dabf88c9b66 | |
parent | 223ad2fd0d355a9caf3c12fe2a286030d7f3190f (diff) | |
download | bitcoin-fae5c633dc05a045aaac370b383e4799cb0e0590.tar.xz |
move-only: Move CAddrMan::Check to cpp file
This speeds up compilation of the whole program because the included
header file is smaller.
Can be reviewed with --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space
-rw-r--r-- | src/addrman.cpp | 11 | ||||
-rw-r--r-- | src/addrman.h | 11 |
2 files changed, 12 insertions, 10 deletions
diff --git a/src/addrman.cpp b/src/addrman.cpp index a1e8cb1bf1..e3f370134f 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -743,6 +743,17 @@ CAddrInfo CAddrMan::Select_(bool newOnly) const } } +void CAddrMan::Check() const +{ + AssertLockHeld(cs); + + const int err = Check_(); + if (err) { + LogPrintf("ADDRMAN CONSISTENCY CHECK FAILED!!! err=%i\n", err); + assert(false); + } +} + int CAddrMan::Check_() const { AssertLockHeld(cs); diff --git a/src/addrman.h b/src/addrman.h index 0885231ebc..ca291d60ab 100644 --- a/src/addrman.h +++ b/src/addrman.h @@ -392,16 +392,7 @@ private: CAddrInfo SelectTriedCollision_() EXCLUSIVE_LOCKS_REQUIRED(cs); //! Consistency check - void Check() const EXCLUSIVE_LOCKS_REQUIRED(cs) - { - AssertLockHeld(cs); - - const int err = Check_(); - if (err) { - LogPrintf("ADDRMAN CONSISTENCY CHECK FAILED!!! err=%i\n", err); - assert(false); - } - } + void Check() const EXCLUSIVE_LOCKS_REQUIRED(cs); //! Perform consistency check. Returns an error code or zero. int Check_() const EXCLUSIVE_LOCKS_REQUIRED(cs); |