diff --git a/config/sia.go b/config/sia.go index e635476..e309400 100644 --- a/config/sia.go +++ b/config/sia.go @@ -6,14 +6,14 @@ var _ Validator = (*SiaConfig)(nil) var _ Defaults = (*SiaConfig)(nil) type SiaConfig struct { - Key string `mapstructure:"key"` - URL string `mapstructure:"url"` - PriceHistoryDays uint64 `mapstructure:"price_history_days"` - MaxUploadPrice float64 `mapstructure:"max_upload_price"` - MaxDownloadPrice float64 `mapstructure:"max_download_price"` - MaxStoragePrice float64 `mapstructure:"max_storage_price"` - MaxContractPrice float64 `mapstructure:"max_contract_price"` - MaxRPCPrice float64 `mapstructure:"max_rpc_price"` + Key string `mapstructure:"key"` + URL string `mapstructure:"url"` + PriceHistoryDays uint64 `mapstructure:"price_history_days"` + MaxUploadPrice float64 `mapstructure:"max_upload_price"` + MaxDownloadPrice float64 `mapstructure:"max_download_price"` + MaxStoragePrice float64 `mapstructure:"max_storage_price"` + MaxContractSCPrice float64 `mapstructure:"max_contract_sc_price"` + MaxRPCSCPrice float64 `mapstructure:"max_rpc_sc_price"` } func (s SiaConfig) Defaults() map[string]interface{} { @@ -43,12 +43,12 @@ func (s SiaConfig) Validate() error { return errors.New("core.storage.sia.max_storage_price must be greater than 0") } - if s.MaxContractPrice <= 0 { - return errors.New("core.storage.sia.max_contract_price must be greater than 0") + if s.MaxRPCSCPrice <= 0 { + return errors.New("core.storage.sia.max_rpc_sc_price must be greater than 0") } - if s.MaxRPCPrice <= 0 { - return errors.New("core.storage.sia.max_rpc_price must be greater than 0") + if s.MaxRPCSCPrice <= 0 { + return errors.New("core.storage.sia.max_contract_sc_price must be greater than 0") } return nil diff --git a/renter/price_tracker.go b/renter/price_tracker.go index 1137798..f1d3098 100644 --- a/renter/price_tracker.go +++ b/renter/price_tracker.go @@ -128,20 +128,20 @@ SELECT AVG(rate) as average_rate FROM ( return err } - maxContractPrice := p.config.Config().Core.Storage.Sia.MaxContractPrice / averageRate + maxContractPrice := p.config.Config().Core.Storage.Sia.MaxContractSCPrice p.logger.Debug("Setting max contract price", zap.Float64("maxContractPrice", maxContractPrice)) - gouge.MaxContractPrice, err = siacoinsFromFloat(p.config.Config().Core.Storage.Sia.MaxContractPrice / averageRate) + gouge.MaxContractPrice, err = siacoinsFromFloat(maxContractPrice) if err != nil { return err } - maxRPCPrice := p.config.Config().Core.Storage.Sia.MaxRPCPrice / averageRate + maxRPCPrice := p.config.Config().Core.Storage.Sia.MaxRPCSCPrice / averageRate p.logger.Debug("Setting max RPC price", zap.Float64("maxRPCPrice", maxRPCPrice)) - gouge.MaxRPCPrice, err = siacoinsFromFloat(p.config.Config().Core.Storage.Sia.MaxRPCPrice / averageRate) + gouge.MaxRPCPrice, err = siacoinsFromFloat(maxRPCPrice) if err != nil { return err }