File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import (
1616)
1717
1818const DiscoveryProtocol = "/tss/discovery/1.0.0"
19- const GossipInterval = 3 * time .Second
19+ const GossipInterval = 10 * time .Second
2020
2121type PeerDiscovery struct {
2222 host host.Host
@@ -166,7 +166,7 @@ func (pd *PeerDiscovery) gossipPeers(ctx context.Context) {
166166 continue
167167 }
168168 for _ , p := range recvPeers {
169- pd .logger .Info ().Msgf ("Adding peer %s" , p )
169+ pd .logger .Debug ().Msgf ("Adding peer %s" , p )
170170 pd .addPeer (p )
171171 }
172172
Original file line number Diff line number Diff line change @@ -232,17 +232,16 @@ func (t *TssServer) GetLocalPeerID() string {
232232}
233233
234234// GetKnownPeers return the the ID and IP address of all peers.
235- func (t * TssServer ) GetKnownPeers () []PeerInfo {
236- infos := [] PeerInfo {}
235+ func (t * TssServer ) GetKnownPeers () []peer. AddrInfo {
236+ var infos []peer. AddrInfo
237237 host := t .p2pCommunication .GetHost ()
238238
239239 for _ , conn := range host .Network ().Conns () {
240- peer := conn .RemotePeer ()
240+ p := conn .RemotePeer ()
241241 addrs := conn .RemoteMultiaddr ()
242- ip , _ := addrs .ValueForProtocol (maddr .P_IP4 )
243- pi := PeerInfo {
244- ID : peer .String (),
245- Address : ip ,
242+ pi := peer.AddrInfo {
243+ p ,
244+ []maddr.Multiaddr {addrs },
246245 }
247246 infos = append (infos , pi )
248247 }
You can’t perform that action at this time.
0 commit comments