Skip to content

Commit

Permalink
Merge branch 'master' into geth-v1.13.8
Browse files Browse the repository at this point in the history
  • Loading branch information
darioush authored May 13, 2024
2 parents 1523fd0 + 55b0ac5 commit 1c58950
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions peer/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,12 +505,11 @@ func (n *network) Connected(ctx context.Context, nodeID ids.NodeID, nodeVersion
return nil
}

if nodeID == n.self {
log.Debug("skipping registering self as peer")
return nil
if nodeID != n.self {
// The legacy peer tracker doesn't expect to be connected to itself.
n.peers.Connected(nodeID, nodeVersion)
}

n.peers.Connected(nodeID, nodeVersion)
return n.p2pNetwork.Connected(ctx, nodeID, nodeVersion)
}

Expand All @@ -524,7 +523,11 @@ func (n *network) Disconnected(ctx context.Context, nodeID ids.NodeID) error {
return nil
}

n.peers.Disconnected(nodeID)
if nodeID != n.self {
// The legacy peer tracker doesn't expect to be connected to itself.
n.peers.Disconnected(nodeID)
}

return n.p2pNetwork.Disconnected(ctx, nodeID)
}

Expand Down

0 comments on commit 1c58950

Please sign in to comment.