aboutsummaryrefslogtreecommitdiff
path: root/src/addrman.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-05-13 12:13:27 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-07-21 16:01:09 +0200
commitfa02934c8c9d290ea4d12683e8680c70967a4d3a (patch)
tree01b2fb4dccf059f74b54adcce97f53ad301c72bb /src/addrman.h
parenta3791da0e80ab35e862989373f033e5be4dff26b (diff)
downloadbitcoin-fa02934c8c9d290ea4d12683e8680c70967a4d3a.tar.xz
refactor: Mark CAddrMan::Select const
Diffstat (limited to 'src/addrman.h')
-rw-r--r--src/addrman.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/addrman.h b/src/addrman.h
index 1fc64ac07f..02b8c5d9a2 100644
--- a/src/addrman.h
+++ b/src/addrman.h
@@ -579,7 +579,7 @@ public:
/**
* Choose an address to connect to.
*/
- CAddrInfo Select(bool newOnly = false)
+ CAddrInfo Select(bool newOnly = false) const
EXCLUSIVE_LOCKS_REQUIRED(!cs)
{
LOCK(cs);
@@ -631,7 +631,7 @@ protected:
uint256 nKey;
//! Source of random numbers for randomization in inner loops
- FastRandomContext insecure_rand;
+ mutable FastRandomContext insecure_rand;
private:
//! A mutex to protect the inner data structures.
@@ -718,7 +718,7 @@ private:
void Attempt_(const CService &addr, bool fCountFailure, int64_t nTime) EXCLUSIVE_LOCKS_REQUIRED(cs);
//! Select an address to connect to, if newOnly is set to true, only the new table is selected from.
- CAddrInfo Select_(bool newOnly) EXCLUSIVE_LOCKS_REQUIRED(cs);
+ CAddrInfo Select_(bool newOnly) const EXCLUSIVE_LOCKS_REQUIRED(cs);
//! See if any to-be-evicted tried table entries have been tested and if so resolve the collisions.
void ResolveCollisions_() EXCLUSIVE_LOCKS_REQUIRED(cs);
@@ -727,7 +727,7 @@ private:
CAddrInfo SelectTriedCollision_() EXCLUSIVE_LOCKS_REQUIRED(cs);
//! Consistency check
- void Check()
+ void Check() const
EXCLUSIVE_LOCKS_REQUIRED(cs)
{
#ifdef DEBUG_ADDRMAN
@@ -741,7 +741,7 @@ private:
#ifdef DEBUG_ADDRMAN
//! Perform consistency check. Returns an error code or zero.
- int Check_() EXCLUSIVE_LOCKS_REQUIRED(cs);
+ int Check_() const EXCLUSIVE_LOCKS_REQUIRED(cs);
#endif
/**