From a4521955d575aa5cc73ec6e760eec0d48ebf2ec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 18 Dec 2019 20:33:13 +0100 Subject: [PATCH] libp2p: enable ping --- .gitignore | 1 + node/modules/lp2p/host.go | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 21f015e88..ce84e704d 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ /lotuspond/front/build /cmd/lotus-townhall/townhall/node_modules /cmd/lotus-townhall/townhall/build +extern/filecoin-ffi/rust/target **/*.h **/*.a **/*.pc diff --git a/node/modules/lp2p/host.go b/node/modules/lp2p/host.go index 6564b62fe..ccb579763 100644 --- a/node/modules/lp2p/host.go +++ b/node/modules/lp2p/host.go @@ -42,7 +42,12 @@ func Host(mctx helpers.MetricsCtx, lc fx.Lifecycle, params P2PHostIn) (RawHost, return nil, fmt.Errorf("missing private key for node ID: %s", params.ID.Pretty()) } - opts := []libp2p.Option{libp2p.Identity(pkey), libp2p.Peerstore(params.Peerstore), libp2p.NoListenAddrs, libp2p.UserAgent("lotus-" + build.UserVersion)} + opts := []libp2p.Option{ + libp2p.Identity(pkey), + libp2p.Peerstore(params.Peerstore), + libp2p.NoListenAddrs, + libp2p.Ping(true), + libp2p.UserAgent("lotus-" + build.UserVersion)} for _, o := range params.Opts { opts = append(opts, o...) }