Fix usage of Network configuration parameter
This commit is contained in:
parent
a4f1730364
commit
c3cdf9bca4
@ -160,12 +160,7 @@ func (b *EthereumRPC) Initialize() error {
|
||||
return errors.Errorf("Unknown network id %v", id)
|
||||
}
|
||||
|
||||
networkConfig := b.ChainConfig.Network
|
||||
if networkConfig == "" {
|
||||
networkConfig = b.ChainConfig.CoinShortcut
|
||||
}
|
||||
|
||||
err = b.initStakingPools(networkConfig)
|
||||
err = b.initStakingPools()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -11,7 +11,11 @@ import (
|
||||
"github.com/trezor/blockbook/bchain"
|
||||
)
|
||||
|
||||
func (b *EthereumRPC) initStakingPools(network string) error {
|
||||
func (b *EthereumRPC) initStakingPools() error {
|
||||
network := b.ChainConfig.Network
|
||||
if network == "" {
|
||||
network = b.ChainConfig.CoinShortcut
|
||||
}
|
||||
// for now only single staking pool
|
||||
envVar := strings.ToUpper(network) + "_STAKING_POOL_CONTRACT"
|
||||
envValue := os.Getenv(envVar)
|
||||
|
||||
@ -438,6 +438,11 @@ func (b *BulkConnect) Close() error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := b.d.SetInconsistentState(false); err != nil {
|
||||
return err
|
||||
}
|
||||
glog.Info("rocksdb: bulk connect closed, db set to open state")
|
||||
|
||||
bt, err := b.d.loadBlockTimes()
|
||||
if err != nil {
|
||||
return err
|
||||
@ -446,11 +451,7 @@ func (b *BulkConnect) Close() error {
|
||||
if b.d.metrics != nil {
|
||||
b.d.metrics.AvgBlockPeriod.Set(float64(avg))
|
||||
}
|
||||
|
||||
if err := b.d.SetInconsistentState(false); err != nil {
|
||||
return err
|
||||
}
|
||||
glog.Info("rocksdb: bulk connect closed, db set to open state")
|
||||
glog.Info("rocksdb: processed block times")
|
||||
b.d = nil
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ func NewFiatRates(db *db.RocksDB, config *common.Config, metrics *common.Metrics
|
||||
// a small hack - in tests the callback is not used, therefore there is no delay slowing down the test
|
||||
throttle = false
|
||||
}
|
||||
fr.downloader = NewCoinGeckoDownloader(db, db.GetInternalState().CoinShortcut, rdParams.URL, rdParams.Coin, rdParams.PlatformIdentifier, rdParams.PlatformVsCurrency, fr.allowedVsCurrencies, fr.timeFormat, metrics, throttle)
|
||||
fr.downloader = NewCoinGeckoDownloader(db, db.GetInternalState().GetNetwork(), rdParams.URL, rdParams.Coin, rdParams.PlatformIdentifier, rdParams.PlatformVsCurrency, fr.allowedVsCurrencies, fr.timeFormat, metrics, throttle)
|
||||
if is != nil {
|
||||
is.HasFiatRates = true
|
||||
is.HasTokenFiatRates = fr.downloadTokens
|
||||
|
||||
Loading…
Reference in New Issue
Block a user