OSDN Git Service

fix review
authormars <mars@bytom.io>
Fri, 19 Jul 2019 08:11:09 +0000 (16:11 +0800)
committermars <mars@bytom.io>
Fri, 19 Jul 2019 08:14:16 +0000 (16:14 +0800)
cmd/reward/command/init.go
cmd/reward/command/run.go
toolbar/reward/rewardinstance/vote_info.go [deleted file]
toolbar/reward/synchron/block_keeper.go

index f7e3f8a..1ffe729 100644 (file)
@@ -29,6 +29,7 @@ func initFiles(cmd *cobra.Command, args []string) {
        configFilePath := cfg.ConfigFile()
        if _, err := os.Stat(configFilePath); !os.IsNotExist(err) {
                log.WithFields(log.Fields{"module": logModule, "config": configFilePath}).Fatal("Already exists config file.")
+               return
        }
 
        if err := cfg.ExportFederationFile(configFilePath, config); err != nil {
index 6a77602..b3b5d5f 100644 (file)
@@ -35,7 +35,7 @@ var (
 )
 
 func init() {
-       runRewardCmd.Flags().Uint64Var(&rewardStartHeight, "reward_start_height", 1, "The starting height of the distributive income reward interval")
+       runRewardCmd.Flags().Uint64Var(&rewardStartHeight, "reward_start_height", 1200, "The starting height of the distributive income reward interval")
        runRewardCmd.Flags().Uint64Var(&rewardEndHeight, "reward_end_height", 2400, "The end height of the distributive income reward interval")
 
        RootCmd.AddCommand(runRewardCmd)
diff --git a/toolbar/reward/rewardinstance/vote_info.go b/toolbar/reward/rewardinstance/vote_info.go
deleted file mode 100644 (file)
index 9af4ed1..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-package reward
-
-type VoteInfo struct {
-       XPub         string
-       Address      string
-       VoteNum      uint64
-       VoteHeight   uint64
-       VetoHeight   uint64
-       VoteBlockNum uint64
-}
index 400dc8a..e6c6cfd 100644 (file)
@@ -24,7 +24,6 @@ type ChainKeeper struct {
 }
 
 func NewChainKeeper(db *gorm.DB, cfg *config.Config, syncHeight uint64) *ChainKeeper {
-
        keeper := &ChainKeeper{
                cfg:        &cfg.Chain,
                db:         db,
@@ -55,7 +54,6 @@ func NewChainKeeper(db *gorm.DB, cfg *config.Config, syncHeight uint64) *ChainKe
 }
 
 func (c *ChainKeeper) Start() {
-
        for {
                blockState := &orm.BlockState{}
                if err := c.db.First(blockState).Error; err != nil {