Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
godeamon committed Feb 15, 2023
1 parent 83d7d39 commit 6e89241
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion example/xchain/conf/engine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ txidCacheExpiredTime: 3m
txIdCacheGCInterval: 10m

# 只有在 single 共识下生效,true:不创建空区块
DisableEmyptBlocks: false
disableEmptyBlocks: false
2 changes: 1 addition & 1 deletion kernel/engines/xuperos/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type EngineConf struct {
SyncBlockFilterMode int `yaml:"syncBlockFilterMode,omitempty"`
// SyncFactorForFactorBucketMode only use for SyncWithFactorBucket mode of SyncBlockFilterMode configuration item
SyncFactorForFactorBucketMode float64 `yaml:"SyncFactorForFactorBucketMode,omitempty"`
DisableEmyptBlocks bool `yaml:"DisableEmyptBlocks,omitempty"`
DisableEmptyBlocks bool `yaml:"disableEmptyBlocks,omitempty"`
}

func LoadEngineConf(cfgFile string) (*EngineConf, error) {
Expand Down
5 changes: 3 additions & 2 deletions kernel/engines/xuperos/miner/miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const (

statusFollowing = 0
statusMining = 1
ConsensusSingle = "single"
)

const (
Expand Down Expand Up @@ -206,13 +207,13 @@ func (m *Miner) step() error {
trace("syncUpValidators")
}
m.status = statusMining
if m.ctx.EngCtx.EngCfg.DisableEmyptBlocks && !m.ctx.State.HasUnconfirmTx() {
if m.ctx.EngCtx.EngCfg.DisableEmptyBlocks && !m.ctx.State.HasUnconfirmTx() {
consensusStatus, err := m.ctx.Consensus.GetConsensusStatus()
if err != nil {
return err
}
// 目前不出空块配置只在 single 共识下生效
if consensusStatus.GetConsensusName() == "single" {
if consensusStatus.GetConsensusName() == ConsensusSingle {
return nil
}
}
Expand Down

0 comments on commit 6e89241

Please sign in to comment.