Skip to content
This repository was archived by the owner on Sep 6, 2022. It is now read-only.

Commit 22092ab

Browse files
changes as per review
1 parent 3ff44e3 commit 22092ab

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

event/network.go

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
package event
22

3-
import "github.com/libp2p/go-libp2p-core/network"
3+
import (
4+
"github.com/libp2p/go-libp2p-core/network"
5+
"github.com/libp2p/go-libp2p-core/peer"
6+
)
47

5-
// EvtPeerStateChange should be emitted everytime we form a connection with a peer or drop our last
8+
// EvtPeerConnectednessChange should be emitted every time we form a connection with a peer or drop our last
69
// connection with the peer. Essentially, it is emitted in two cases:
710
// a) We form a/any connection with a peer.
811
// b) We go from having a connection/s with a peer to having no connection with the peer.
9-
// It contains the connection handle and the new connection state.
10-
type EvtPeerStateChange struct {
11-
Connection network.Conn
12-
NewState network.Connectedness
12+
// It contains the Id of the remote peer and the new connectedness state.
13+
type EvtPeerConnectednessChange struct {
14+
RemotePeerId peer.ID
15+
Connectedness network.Connectedness
1316
}

0 commit comments

Comments
 (0)