[net processing] Add RemovePeer()

This allows us to avoid repeated locking in FinalizeNode()
This commit is contained in:
John Newbery
2020-09-24 10:11:30 +01:00
parent a20ab22786
commit 3025ca9e77
2 changed files with 17 additions and 3 deletions

View File

@@ -143,6 +143,10 @@ private:
* May return an empty shared_ptr if the Peer object can't be found. */
PeerRef GetPeerRef(NodeId id) const;
/** Get a shared pointer to the Peer object and remove it from m_peer_map.
* May return an empty shared_ptr if the Peer object can't be found. */
PeerRef RemovePeer(NodeId id);
/**
* Potentially mark a node discouraged based on the contents of a BlockValidationState object
*