mirror of https://github.com/status-im/go-waku.git
adds DialbyPeerID
This commit is contained in:
parent
11bf973daf
commit
4450e6bba0
|
@ -697,7 +697,6 @@ func (w *WakuNode) DialPeer(address string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
// Extract the peer ID from the multiaddr.
|
||||
info, err := peer.AddrInfoFromP2pAddr(p)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -706,6 +705,11 @@ func (w *WakuNode) DialPeer(address string) error {
|
|||
return w.host.Connect(w.ctx, *info)
|
||||
}
|
||||
|
||||
func (w *WakuNode) DialPeerByID(peerID peer.ID) error {
|
||||
info := w.host.Peerstore().PeerInfo(peerID)
|
||||
return w.host.Connect(w.ctx, info)
|
||||
}
|
||||
|
||||
func (w *WakuNode) ClosePeerByAddress(address string) error {
|
||||
p, err := ma.NewMultiaddr(address)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue