aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-07-08 21:57:19 +0200
committerMarcoFalke <falke.marco@gmail.com>2020-07-08 21:57:25 +0200
commit9f4c0a9694d399388d0514c13feae7d2303fac3d (patch)
treed8a2396c69d715fb3e3e6e4e00bd1a903f0d570f /src/net.cpp
parentabdfd2d0e3ebec7dbead89317ee9192189a35809 (diff)
parente8a2822119233ade0de84f791a9e92918a3d6896 (diff)
Merge #19347: [net] Make cs_inventory nonrecursive
e8a2822119233ade0de84f791a9e92918a3d6896 [net] Don't try to take cs_inventory before deleting CNode (John Newbery) 3556227ddd3365cfac43b307204d73058b2943f0 [net] Make cs_inventory a non-recursive mutex (John Newbery) 344e831de54f7b864f03a90f6cb19692eafcd463 [net processing] Remove PushBlockInventory and PushBlockHash (John Newbery) Pull request description: - Remove PushBlockInventory() and PushBlockHash(). These are one-line functions that can easy be inlined into the calling code. Doing so also allows us to eliminate the one place that cs_inventory is recursively locked. - Make cs_inventory a nonrecursive mutex - Remove a redundant TRY_LOCK of cs_inventory when deleting CNode. ACKs for top commit: sipa: utACK e8a2822119233ade0de84f791a9e92918a3d6896 MarcoFalke: ACK e8a2822119233ade0de84f791a9e92918a3d6896 🍬 hebasto: re-ACK e8a2822119233ade0de84f791a9e92918a3d6896 Tree-SHA512: dbc721d102cdef7b5827a8f2549daf8b54f543050266999a7ea56c9f36618565b71e31ce0beb1209ba2db43d15388be173355a03fb6db8ad24e2475b145050bd
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 0233b0fc2f..21d340b516 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -1110,12 +1110,9 @@ void CConnman::DisconnectNodes()
if (pnode->GetRefCount() <= 0) {
bool fDelete = false;
{
- TRY_LOCK(pnode->cs_inventory, lockInv);
- if (lockInv) {
- TRY_LOCK(pnode->cs_vSend, lockSend);
- if (lockSend) {
- fDelete = true;
- }
+ TRY_LOCK(pnode->cs_vSend, lockSend);
+ if (lockSend) {
+ fDelete = true;
}
}
if (fDelete) {