network: use TimePerBlock from config

This commit is contained in:
Evgenii Stratonikov 2020-01-13 17:57:40 +03:00
parent 4d56fde98a
commit 5f5d0097e2
2 changed files with 6 additions and 0 deletions

View file

@ -108,6 +108,8 @@ func NewServer(config ServerConfig, chain core.Blockchainer, log *zap.Logger) *S
Chain: chain,
RequestTx: s.requestTx,
Wallet: config.Wallet,
TimePerBlock: config.TimePerBlock,
})
if err != nil {
return nil

View file

@ -57,6 +57,9 @@ type (
// Wallet is a wallet configuration.
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,
MinPeers: appConfig.MinPeers,
Wallet: wc,
TimePerBlock: time.Duration(protoConfig.SecondsPerBlock) * time.Second,
}
}