forked from TrueCloudLab/neoneo-go
network: use TimePerBlock from config
This commit is contained in:
parent
4d56fde98a
commit
5f5d0097e2
2 changed files with 6 additions and 0 deletions
|
@ -108,6 +108,8 @@ func NewServer(config ServerConfig, chain core.Blockchainer, log *zap.Logger) *S
|
||||||
Chain: chain,
|
Chain: chain,
|
||||||
RequestTx: s.requestTx,
|
RequestTx: s.requestTx,
|
||||||
Wallet: config.Wallet,
|
Wallet: config.Wallet,
|
||||||
|
|
||||||
|
TimePerBlock: config.TimePerBlock,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -57,6 +57,9 @@ type (
|
||||||
|
|
||||||
// Wallet is a wallet configuration.
|
// Wallet is a wallet configuration.
|
||||||
Wallet *config.WalletConfig
|
Wallet *config.WalletConfig
|
||||||
|
|
||||||
|
// TimePerBlock is an interval which should pass between two successive blocks.
|
||||||
|
TimePerBlock time.Duration
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -84,5 +87,6 @@ func NewServerConfig(cfg config.Config) ServerConfig {
|
||||||
AttemptConnPeers: appConfig.AttemptConnPeers,
|
AttemptConnPeers: appConfig.AttemptConnPeers,
|
||||||
MinPeers: appConfig.MinPeers,
|
MinPeers: appConfig.MinPeers,
|
||||||
Wallet: wc,
|
Wallet: wc,
|
||||||
|
TimePerBlock: time.Duration(protoConfig.SecondsPerBlock) * time.Second,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue