Skip to content

Commit

Permalink
Base 075 up (#89)
Browse files Browse the repository at this point in the history
* update p2pProtocolVer and dhtProtocolVer

* update ParseMultiaddrs
  • Loading branch information
AstaFrode authored Nov 16, 2023
1 parent df1867d commit 11e227d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions core/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ const (
)

const (
p2pProtocolVer = "/1.0"
dhtProtocolVer = "/kad/1.0"
p2pProtocolVer = "/protoco/1.0"
dhtProtocolVer = "/dht/1.0"
rendezvous = "/rendezvous/1.0"
)

Expand Down
8 changes: 2 additions & 6 deletions core/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,8 @@ func ParseMultiaddrs(domain string) ([]string, error) {
if err != nil {
return result, err
}

for _, v := range dnsnames {
if strings.Contains(v, "ip4") && strings.Contains(v, "tcp") && strings.Count(v, "=") == 1 {
if strings.Contains(v, "ip4") && strings.Contains(v, "tcp") {
result = append(result, strings.TrimPrefix(v, "dnsaddr="))
}
}
Expand Down Expand Up @@ -250,9 +249,6 @@ func FindFile(dir, name string) string {
}
return nil
})

if err != nil {
fmt.Println(err)
}
_ = err
return result
}

0 comments on commit 11e227d

Please sign in to comment.