aboutsummaryrefslogtreecommitdiff
path: root/src/addrman_impl.h
diff options
context:
space:
mode:
authorjosibake <josibake@protonmail.com>2021-12-10 15:37:04 +0100
committerjosibake <josibake@protonmail.com>2021-12-14 17:50:24 +0100
commit207f1c825c632c54af009516d376d392ea9106fa (patch)
tree64768e913db4051ecff273c4bd49907545cde1e0 /src/addrman_impl.h
parent5dd28e5cff8a8177b969181ecb58d045e7f80a72 (diff)
refactor: make AddrMan::Good return bool
If AddrMan::Good is unable to add an entry to tried (for a number of reasons), return false. This makes it much easier and cleaner to directly test for tried collisions. It also allows anyone calling Good() to handle the case where adding an address to tried is unsuccessful. Update docs to doxygen style.
Diffstat (limited to 'src/addrman_impl.h')
-rw-r--r--src/addrman_impl.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/addrman_impl.h b/src/addrman_impl.h
index 10a65871c1..bd7caf473b 100644
--- a/src/addrman_impl.h
+++ b/src/addrman_impl.h
@@ -115,7 +115,7 @@ public:
bool Add(const std::vector<CAddress>& vAddr, const CNetAddr& source, int64_t nTimePenalty)
EXCLUSIVE_LOCKS_REQUIRED(!cs);
- void Good(const CService& addr, int64_t nTime)
+ bool Good(const CService& addr, int64_t nTime)
EXCLUSIVE_LOCKS_REQUIRED(!cs);
void Attempt(const CService& addr, bool fCountFailure, int64_t nTime)
@@ -248,7 +248,7 @@ private:
* @see AddrMan::Add() for parameters. */
bool AddSingle(const CAddress& addr, const CNetAddr& source, int64_t nTimePenalty) EXCLUSIVE_LOCKS_REQUIRED(cs);
- void Good_(const CService& addr, bool test_before_evict, int64_t time) EXCLUSIVE_LOCKS_REQUIRED(cs);
+ bool Good_(const CService& addr, bool test_before_evict, int64_t time) EXCLUSIVE_LOCKS_REQUIRED(cs);
bool Add_(const std::vector<CAddress> &vAddr, const CNetAddr& source, int64_t nTimePenalty) EXCLUSIVE_LOCKS_REQUIRED(cs);