aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2020-10-19 09:03:19 +0800
committerfanquake <fanquake@gmail.com>2020-10-19 10:25:38 +0800
commitc92aa8357c36a63b7a97d8a1bc09036a0d2661b3 (patch)
treeed9434633b97f80e3c869d16752fff8803438b55 /src/net.h
parent80c8a02f1b4f6ad2b5c02595d66a74db22373ed4 (diff)
parentda0988daf1d665a4644ad3f1ddf3f8a8bdd88cde (diff)
downloadbitcoin-c92aa8357c36a63b7a97d8a1bc09036a0d2661b3.tar.xz
Merge #19911: net: guard vRecvGetData with cs_vRecv and orphan_work_set with g_cs_orphans
da0988daf1d665a4644ad3f1ddf3f8a8bdd88cde scripted-diff: rename vRecvGetData (Neha Narula) ba951812ec0cc8ebee5911a582f188525b76ff0a Guard vRecvGetData (now in net processing) with its own mutex (Neha Narula) 2d9f2fca43aadcdda4d644cddab36dca88b40b97 Move vRecvGetData to net processing (Neha Narula) 673247b58cd1252ab7e99f7d63ead05cc100cef2 Lock before checking if orphan_work_set is empty; indicate it is guarded (Neha Narula) 8803aee66813d27ddbdfce937ab9c35f8f7c35bc Move m_orphan_work_set to net_processing (Neha Narula) 9c47cb29f9f525ee58acc629825a97075156d764 [Rename only] Rename orphan_work_set to m_orphan_work_set. (Neha Narula) Pull request description: Add annotations to guard `vRecvGetData` and `orphan_work_set` and fix up places where they were accessed without a lock. There is no current data race because they happen to be accessed by only one thread, but this might not always be the case. Original discussion: https://github.com/bitcoin/bitcoin/pull/18861#discussion_r451778445 ACKs for top commit: MarcoFalke: review ACK da0988daf1d665a4644ad3f1ddf3f8a8bdd88cde 🐬 jnewbery: Code review ACK da0988daf1d665a4644ad3f1ddf3f8a8bdd88cde hebasto: ACK da0988daf1d665a4644ad3f1ddf3f8a8bdd88cde, I have reviewed the code and it looks correct, I agree it can be merged. Tree-SHA512: 31cadd319ddc9273a87e77afc4db7339fd636e816b5e742eba5cb32927ac5cc07a672b2268d2d38a75a0f1b17d93836adab9acf7e52f26ea9a43f54efa57257e
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/net.h b/src/net.h
index 55de7afa05..2652d82ea0 100644
--- a/src/net.h
+++ b/src/net.h
@@ -857,7 +857,6 @@ public:
RecursiveMutex cs_sendProcessing;
- std::deque<CInv> vRecvGetData;
uint64_t nRecvBytes GUARDED_BY(cs_vRecv){0};
std::atomic<int64_t> nLastSend{0};
@@ -1051,8 +1050,6 @@ public:
// Whether a ping is requested.
std::atomic<bool> fPingQueued{false};
- std::set<uint256> orphan_work_set;
-
CNode(NodeId id, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn, SOCKET hSocketIn, const CAddress &addrIn, uint64_t nKeyedNetGroupIn, uint64_t nLocalHostNonceIn, const CAddress &addrBindIn, const std::string &addrNameIn, ConnectionType conn_type_in, bool inbound_onion = false);
~CNode();
CNode(const CNode&) = delete;