Skip to content

Commit 90633f6

Browse files
authored
mocknet: notify listeners on listen (libp2p#3310)
1 parent 2d45a88 commit 90633f6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

p2p/net/mock/mock_peernet.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,11 @@ func (pn *peernet) BandwidthTotals() (in uint64, out uint64) {
361361
// Listen tells the network to start listening on given multiaddrs.
362362
func (pn *peernet) Listen(addrs ...ma.Multiaddr) error {
363363
pn.Peerstore().AddAddrs(pn.LocalPeer(), addrs, peerstore.PermanentAddrTTL)
364+
for _, a := range addrs {
365+
pn.notifyAll(func(n network.Notifiee) {
366+
n.Listen(pn, a)
367+
})
368+
}
364369
return nil
365370
}
366371

0 commit comments

Comments
 (0)