diff options
Diffstat (limited to 'src/addrman.h')
-rw-r--r-- | src/addrman.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/addrman.h b/src/addrman.h index 16be374f7b..2503f53a35 100644 --- a/src/addrman.h +++ b/src/addrman.h @@ -493,9 +493,11 @@ public: mapAddr.clear(); } - CAddrMan() + explicit CAddrMan(bool deterministic) + : insecure_rand{deterministic} { Clear(); + if (deterministic) nKey.SetNull(); } ~CAddrMan() @@ -637,13 +639,13 @@ protected: //! secret key to randomize bucket select with uint256 nKey; - //! Source of random numbers for randomization in inner loops - mutable FastRandomContext insecure_rand GUARDED_BY(cs); - //! A mutex to protect the inner data structures. mutable Mutex cs; private: + //! Source of random numbers for randomization in inner loops + mutable FastRandomContext insecure_rand GUARDED_BY(cs); + //! Serialization versions. enum Format : uint8_t { V0_HISTORICAL = 0, //!< historic format, before commit e6b343d88 |