Plumb contexts through

This commit is contained in:
Aayush Rajasekaran
2022-01-11 19:51:08 -05:00
committed by Jennifer Wang
parent df943d3f4e
commit 5cb33b48da
71 changed files with 595 additions and 577 deletions
+1 -3
View File
@@ -34,8 +34,6 @@ type P2PHostIn struct {
type RawHost host.Host
func Host(mctx helpers.MetricsCtx, lc fx.Lifecycle, params P2PHostIn) (RawHost, error) {
ctx := helpers.LifecycleCtx(mctx, lc)
pkey := params.Peerstore.PrivKey(params.ID)
if pkey == nil {
return nil, fmt.Errorf("missing private key for node ID: %s", params.ID.Pretty())
@@ -52,7 +50,7 @@ func Host(mctx helpers.MetricsCtx, lc fx.Lifecycle, params P2PHostIn) (RawHost,
opts = append(opts, o...)
}
h, err := libp2p.New(ctx, opts...)
h, err := libp2p.New(opts...)
if err != nil {
return nil, err
}