core: set default SecondsPerBlock value on blockchain creation
As mentioned in the node configuration docs.
This commit is contained in:
parent
70e59d83c9
commit
a91cf2a007
1 changed files with 6 additions and 0 deletions
|
@ -55,6 +55,7 @@ const (
|
||||||
defaultMaxBlockSystemFee = 900000000000
|
defaultMaxBlockSystemFee = 900000000000
|
||||||
defaultMaxTraceableBlocks = 2102400 // 1 year of 15s blocks
|
defaultMaxTraceableBlocks = 2102400 // 1 year of 15s blocks
|
||||||
defaultMaxTransactionsPerBlock = 512
|
defaultMaxTransactionsPerBlock = 512
|
||||||
|
defaultSecondsPerBlock = 15
|
||||||
// HeaderVerificationGasLimit is the maximum amount of GAS for block header verification.
|
// HeaderVerificationGasLimit is the maximum amount of GAS for block header verification.
|
||||||
HeaderVerificationGasLimit = 3_00000000 // 3 GAS
|
HeaderVerificationGasLimit = 3_00000000 // 3 GAS
|
||||||
defaultStateSyncInterval = 40000
|
defaultStateSyncInterval = 40000
|
||||||
|
@ -245,6 +246,11 @@ func NewBlockchain(s storage.Store, cfg config.ProtocolConfiguration, log *zap.L
|
||||||
log.Info("MaxTransactionsPerBlock is not set or wrong, using default value",
|
log.Info("MaxTransactionsPerBlock is not set or wrong, using default value",
|
||||||
zap.Uint16("MaxTransactionsPerBlock", cfg.MaxTransactionsPerBlock))
|
zap.Uint16("MaxTransactionsPerBlock", cfg.MaxTransactionsPerBlock))
|
||||||
}
|
}
|
||||||
|
if cfg.SecondsPerBlock == 0 {
|
||||||
|
cfg.SecondsPerBlock = defaultSecondsPerBlock
|
||||||
|
log.Info("SecondsPerBlock is not set or wrong, using default value",
|
||||||
|
zap.Int("SecondsPerBlock", cfg.SecondsPerBlock))
|
||||||
|
}
|
||||||
if cfg.MaxValidUntilBlockIncrement == 0 {
|
if cfg.MaxValidUntilBlockIncrement == 0 {
|
||||||
const secondsPerDay = int(24 * time.Hour / time.Second)
|
const secondsPerDay = int(24 * time.Hour / time.Second)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue