mirror of https://github.com/status-im/go-waku.git
fix: invalid length of multiaddr field (but loaded succesfully anyway)
This commit is contained in:
parent
11161b8919
commit
78520e9280
|
@ -75,12 +75,17 @@ func Multiaddress(node *enode.Node) ([]multiaddr.Multiaddr, error) {
|
|||
if err := node.Record().Load(enr.WithEntry(MultiaddrENRField, &multiaddrRaw)); err != nil {
|
||||
if !enr.IsNotFound(err) {
|
||||
return nil, err
|
||||
} else if len(multiaddrRaw) < 2 {
|
||||
} else {
|
||||
// No multiaddr entry on enr
|
||||
return result, nil
|
||||
}
|
||||
}
|
||||
|
||||
if len(multiaddrRaw) < 2 {
|
||||
// There was no error loading the multiaddr field, but its length is incorrect
|
||||
return result, nil
|
||||
}
|
||||
|
||||
hostInfo, err := multiaddr.NewMultiaddr(fmt.Sprintf("/p2p/%s", peerID.Pretty()))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Reference in New Issue