mirror of
https://github.com/status-im/go-waku.git
synced 2025-01-13 15:24:46 +00:00
adds DialbyPeerID
This commit is contained in:
parent
11bf973daf
commit
4450e6bba0
@ -697,7 +697,6 @@ func (w *WakuNode) DialPeer(address string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract the peer ID from the multiaddr.
|
|
||||||
info, err := peer.AddrInfoFromP2pAddr(p)
|
info, err := peer.AddrInfoFromP2pAddr(p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -706,6 +705,11 @@ func (w *WakuNode) DialPeer(address string) error {
|
|||||||
return w.host.Connect(w.ctx, *info)
|
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 {
|
func (w *WakuNode) ClosePeerByAddress(address string) error {
|
||||||
p, err := ma.NewMultiaddr(address)
|
p, err := ma.NewMultiaddr(address)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user