aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-04-01 08:29:44 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-04-01 08:29:53 +0200
commit539e4eec63fa5cbc525343c33c40c43f7b48cb6a (patch)
treef92cd700137450773cc6bf0e6503b483913b1673 /src/net.h
parent602b038d433b8f35116c7149175bba191f690bb6 (diff)
parent935d4889228e7e361c8b0020761fa0e08a55fb48 (diff)
downloadbitcoin-539e4eec63fa5cbc525343c33c40c43f7b48cb6a.tar.xz
Merge #21236: net processing: Extract `addr` send functionality into MaybeSendAddr()
935d4889228e7e361c8b0020761fa0e08a55fb48 [net processing] Refactor MaybeSendAddr() (John Newbery) 01a79ff924b11f91796d4aa63c571897b047ac7d [net processing] Fix overindentation in MaybeSendAddr() (John Newbery) 38c0be5da3af17208b165e73cee7612d3670b038 [net processing] Refactor MaybeSendAddr() - early exits (John Newbery) c87423c58b5165de835a49bebd566538a70c07ab [net processing] Change MaybeSendAddr() to take a reference (John Newbery) ad719297f2ecdd2394eff668b3be7070bc9cb3e2 [net processing] Extract `addr` send functionality into MaybeSendAddr() (John Newbery) 4ad4abcf07efefafd439b28679dff8d6bbf62943 [net] Change addr send times fields to be guarded by new mutex (John Newbery) c02fa47baa517e17b5c43bde3902b1e410c1b93f [net processing] Only call GetTime() once in SendMessages() (John Newbery) Pull request description: This continues the work of moving application layer data into net_processing. It refactors `addr` send functionality into its own function `MaybeSendAddr()` and flattens/simplifies the code. Isolating and simplifying the addr handling code makes subsequent changes (which will move addr data and logic into net processing) easier to review. This is a pure refactor. There are no functional changes. For motivation of the project, see #19398. ACKs for top commit: sipa: utACK 935d4889228e7e361c8b0020761fa0e08a55fb48 hebasto: ACK 935d4889228e7e361c8b0020761fa0e08a55fb48, I have reviewed the code and it looks OK, I agree it can be merged. MarcoFalke: review ACK 935d4889228e7e361c8b0020761fa0e08a55fb48 🐑 Tree-SHA512: 4e9dc84603147e74f479a211b42bcf315bdf5d14c21c08cf0b17d6c252775b90b012f0e0d834f1a607ed63c7ed5c63d5cf49b134344e7b64a1695bfcff111c92
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/net.h b/src/net.h
index add48b11a4..cae22969ce 100644
--- a/src/net.h
+++ b/src/net.h
@@ -549,8 +549,9 @@ public:
std::vector<CAddress> vAddrToSend;
std::unique_ptr<CRollingBloomFilter> m_addr_known{nullptr};
bool fGetAddr{false};
- std::chrono::microseconds m_next_addr_send GUARDED_BY(cs_sendProcessing){0};
- std::chrono::microseconds m_next_local_addr_send GUARDED_BY(cs_sendProcessing){0};
+ Mutex m_addr_send_times_mutex;
+ std::chrono::microseconds m_next_addr_send GUARDED_BY(m_addr_send_times_mutex){0};
+ std::chrono::microseconds m_next_local_addr_send GUARDED_BY(m_addr_send_times_mutex){0};
struct TxRelay {
mutable RecursiveMutex cs_filter;