Plumb contexts through
This commit is contained in:
committed by
Jennifer Wang
parent
df943d3f4e
commit
5cb33b48da
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user