block producers should have only one address

This commit is contained in:
Jeromy
2020-05-05 12:01:44 -07:00
parent 299a017ef5
commit 8b58f22c2e
4 changed files with 63 additions and 120 deletions
+3 -3
View File
@@ -264,17 +264,17 @@ func SetupBlockProducer(lc fx.Lifecycle, ds dtypes.MetadataDS, api lapi.FullNode
return nil, err
}
m := miner.NewMiner(api, epp, beacon)
m := miner.NewMiner(api, epp, beacon, minerAddr)
lc.Append(fx.Hook{
OnStart: func(ctx context.Context) error {
if err := m.Register(minerAddr); err != nil {
if err := m.Start(ctx); err != nil {
return err
}
return nil
},
OnStop: func(ctx context.Context) error {
return m.Unregister(ctx, minerAddr)
return m.Stop(ctx)
},
})