Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backport: Merge bitcoin#21750 #5997

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Commits on May 24, 2024

  1. Merge bitcoin#21750: net: remove unnecessary check of CNode::cs_vSend

    9096b13 net: remove unnecessary check of CNode::cs_vSend (Vasil Dimov)
    
    Pull request description:
    
      It is not possible to have a node in `CConnman::vNodesDisconnected` and
      its reference count to be incremented - all `CNode::AddRef()` are done
      either before the node is added to `CConnman::vNodes` or while holding
      `CConnman::cs_vNodes` and the object being in `CConnman::vNodes`.
    
      So, the object being in `CConnman::vNodesDisconnected` and its reference
      count being zero means that it is not and will not start to be used by
      other threads.
    
      So, the lock of `CNode::cs_vSend` in `CConnman::DisconnectNodes()` will
      always succeed and is not necessary.
    
      Indeed all locks of `CNode::cs_vSend` are done either when the reference
      count is >0 or under the protection of `CConnman::cs_vNodes` and the
      node being in `CConnman::vNodes`.
    
    ACKs for top commit:
      MarcoFalke:
        review ACK 9096b13 🏧
      jnewbery:
        utACK 9096b13
    
    Tree-SHA512: 910899cdcdc8934642eb0c40fcece8c3b01b7e20a0b023966b9d6972db6a885cb3a9a04e9562bae14d5833967e45e2ecb3687b94d495060c3da4b1f2afb0ac8f
    MarcoFalke authored and vijaydasmp committed May 24, 2024
    Configuration menu
    Copy the full SHA
    db065b5 View commit details
    Browse the repository at this point in the history