fix: need to divide maxStoragePrice by a tib unit

This commit is contained in:
Derrick Hammer 2024-03-10 14:33:46 -04:00
parent af29081a3a
commit 6eeed24707
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 3 additions and 0 deletions

View File

@ -6,6 +6,8 @@ import (
"math/big" "math/big"
"time" "time"
"github.com/docker/go-units"
"git.lumeweb.com/LumeWeb/portal/db/models" "git.lumeweb.com/LumeWeb/portal/db/models"
"github.com/siacentral/apisdkgo" "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 := p.config.Config().Core.Storage.Sia.MaxStoragePrice / averageRate
maxStoragePrice = maxStoragePrice / redundancy.Redundancy() maxStoragePrice = maxStoragePrice / redundancy.Redundancy()
maxStoragePrice = maxStoragePrice / units.TiB
p.logger.Debug("Setting max storage price", zap.Float64("maxStoragePrice", maxStoragePrice)) p.logger.Debug("Setting max storage price", zap.Float64("maxStoragePrice", maxStoragePrice))