Skip to content

Commit

Permalink
config: consistent default MinerTargetBlockTimeSeconds
Browse files Browse the repository at this point in the history
  • Loading branch information
altergui authored and p4u committed May 8, 2024
1 parent a29dcbc commit 8f6c02b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/node/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func loadConfig() *config.Config {
flag.Bool("vochainStateSyncFetchParamsFromRPC", true,
"allow statesync to fetch TrustHash and TrustHeight from the first RPCServer")

flag.Int("vochainMinerTargetBlockTimeSeconds", 10,
flag.Int("vochainMinerTargetBlockTimeSeconds", config.DefaultMinerTargetBlockTimeSeconds,
"vochain consensus block time target (in seconds)")
flag.Bool("vochainSkipPreviousOffchainData", false,
"if enabled the census downloader will import all existing census")
Expand Down
6 changes: 6 additions & 0 deletions config/defaults.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package config

// These consts are defaults used in VochainCfg
const (
DefaultMinerTargetBlockTimeSeconds = 10
)
2 changes: 1 addition & 1 deletion vochain/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func newTendermint(app *BaseApplication,
}

// consensus config
blockTime := 8
blockTime := config.DefaultMinerTargetBlockTimeSeconds
if localConfig.MinerTargetBlockTimeSeconds > 0 {
blockTime = localConfig.MinerTargetBlockTimeSeconds
}
Expand Down

0 comments on commit 8f6c02b

Please sign in to comment.