From 6eeed247077c9e634d4cef1b608d8542e6e5598b Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 10 Mar 2024 14:33:46 -0400 Subject: [PATCH] fix: need to divide maxStoragePrice by a tib unit --- renter/price_tracker.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/renter/price_tracker.go b/renter/price_tracker.go index f1d3098..32d8b75 100644 --- a/renter/price_tracker.go +++ b/renter/price_tracker.go @@ -6,6 +6,8 @@ import ( "math/big" "time" + "github.com/docker/go-units" + "git.lumeweb.com/LumeWeb/portal/db/models" "github.com/siacentral/apisdkgo" @@ -148,6 +150,7 @@ SELECT AVG(rate) as average_rate FROM ( maxStoragePrice := p.config.Config().Core.Storage.Sia.MaxStoragePrice / averageRate maxStoragePrice = maxStoragePrice / redundancy.Redundancy() + maxStoragePrice = maxStoragePrice / units.TiB p.logger.Debug("Setting max storage price", zap.Float64("maxStoragePrice", maxStoragePrice))