update for new ConnManager constructor

This commit is contained in:
vyzo 2021-12-14 15:30:29 +02:00 committed by Jennifer Wang
parent 1f99550da8
commit 1eb6f77da1

View File

@ -69,7 +69,11 @@ func genLibp2pKey() (crypto.PrivKey, error) {
func ConnectionManager(low, high uint, grace time.Duration, protected []string) func() (opts Libp2pOpts, err error) {
return func() (Libp2pOpts, error) {
cm := connmgr.NewConnManager(int(low), int(high), grace)
cm, err := connmgr.NewConnManager(int(low), int(high), connmgr.WithGracePeriod(grace))
if err != nil {
return Libp2pOpts{}, err
}
for _, p := range protected {
pid, err := peer.IDFromString(p)
if err != nil {