update libp2p

This commit is contained in:
Aarsh Shah
2021-09-21 15:10:04 +04:00
parent 38f7cbc6c7
commit 89ac8b09b5
7 changed files with 209 additions and 123 deletions
-13
View File
@@ -11,19 +11,6 @@ import (
mamask "github.com/whyrusleeping/multiaddr-filter"
)
func AddrFilters(filters []string) func() (opts Libp2pOpts, err error) {
return func() (opts Libp2pOpts, err error) {
for _, s := range filters {
f, err := mamask.NewMask(s)
if err != nil {
return opts, fmt.Errorf("incorrectly formatted address filter in config: %s", s)
}
opts.Opts = append(opts.Opts, libp2p.FilterAddresses(f)) //nolint:staticcheck
}
return opts, nil
}
}
func makeAddrsFactory(announce []string, noAnnounce []string) (p2pbhost.AddrsFactory, error) {
var annAddrs []ma.Multiaddr
for _, addr := range announce {
+1 -1
View File
@@ -42,7 +42,7 @@ func PrivKey(ks types.KeyStore) (crypto.PrivKey, error) {
if err != nil {
return nil, err
}
kbytes, err := pk.Bytes()
kbytes, err := crypto.MarshalPrivateKey(pk)
if err != nil {
return nil, err
}