@@ -4091,7 +4091,7 @@ func (s *server) InboundPeerConnected(conn net.Conn) {
4091
4091
// Remove the current peer from the server's internal state and
4092
4092
// signal that the peer termination watcher does not need to
4093
4093
// execute for this peer.
4094
- s .removePeer (connectedPeer )
4094
+ s .removePeerUnsafe (connectedPeer )
4095
4095
s .ignorePeerTermination [connectedPeer ] = struct {}{}
4096
4096
s .scheduledPeerConnection [pubStr ] = func () {
4097
4097
s .peerConnected (conn , nil , true )
@@ -4208,7 +4208,7 @@ func (s *server) OutboundPeerConnected(connReq *connmgr.ConnReq, conn net.Conn)
4208
4208
// Remove the current peer from the server's internal state and
4209
4209
// signal that the peer termination watcher does not need to
4210
4210
// execute for this peer.
4211
- s .removePeer (connectedPeer )
4211
+ s .removePeerUnsafe (connectedPeer )
4212
4212
s .ignorePeerTermination [connectedPeer ] = struct {}{}
4213
4213
s .scheduledPeerConnection [pubStr ] = func () {
4214
4214
s .peerConnected (conn , connReq , false )
@@ -4730,7 +4730,7 @@ func (s *server) peerTerminationWatcher(p *peer.Brontide, ready chan struct{}) {
4730
4730
4731
4731
// First, cleanup any remaining state the server has regarding the peer
4732
4732
// in question.
4733
- s .removePeer (p )
4733
+ s .removePeerUnsafe (p )
4734
4734
4735
4735
// Next, check to see if this is a persistent peer or not.
4736
4736
if _ , ok := s .persistentPeers [pubStr ]; ! ok {
@@ -4939,11 +4939,11 @@ func (s *server) connectToPersistentPeer(pubKeyStr string) {
4939
4939
}()
4940
4940
}
4941
4941
4942
- // removePeer removes the passed peer from the server's state of all active
4943
- // peers.
4942
+ // removePeerUnsafe removes the passed peer from the server's state of all
4943
+ // active peers.
4944
4944
//
4945
4945
// NOTE: Server mutex must be held when calling this function.
4946
- func (s * server ) removePeer (p * peer.Brontide ) {
4946
+ func (s * server ) removePeerUnsafe (p * peer.Brontide ) {
4947
4947
if p == nil {
4948
4948
return
4949
4949
}
@@ -5147,7 +5147,7 @@ func (s *server) DisconnectPeer(pubKey *btcec.PublicKey) error {
5147
5147
delete (s .persistentPeersBackoff , pubStr )
5148
5148
5149
5149
// Remove the peer by calling Disconnect. Previously this was done with
5150
- // removePeer , which bypassed the peerTerminationWatcher.
5150
+ // removePeerUnsafe , which bypassed the peerTerminationWatcher.
5151
5151
//
5152
5152
// NOTE: We call it in a goroutine to avoid blocking the main server
5153
5153
// goroutine because we might hold the server's mutex.
0 commit comments