OSDN Git Service

fix review
authormars <mars@bytom.io>
Mon, 22 Jul 2019 01:17:08 +0000 (09:17 +0800)
committermars <mars@bytom.io>
Mon, 22 Jul 2019 01:17:08 +0000 (09:17 +0800)
cmd/reward/command/run.go
toolbar/reward/reward.go

index 5694342..328fd0d 100644 (file)
@@ -64,7 +64,9 @@ func runReward(cmd *cobra.Command, args []string) error {
                cmn.Exit(cmn.Fmt("initialize NewChainKeeper error:[%s]", err.Error()))
        }
 
-       sync.Start()
+       if err := sync.Start(); err != nil {
+               cmn.Exit(cmn.Fmt("Failded to sync block:[%s]", err.Error()))
+       }
 
        r := reward.NewReward(db, config, rewardStartHeight, rewardEndHeight)
        if err := r.Start(); err != nil {
index c7a5403..4813431 100644 (file)
@@ -25,11 +25,10 @@ func NewReward(db *gorm.DB, cfg *config.Config, rewardStartHeight, rewardEndHeig
                panic("There are no instances of rewards being handed out, please check the configuration")
        }
 
-       reward := &Reward{
+       return &Reward{
                countReward: countReward,
        }
 
-       return reward
 }
 
 func (r *Reward) Start() error {