From ec27a8a02dd6a2c116e34cdfd9427d03f45b618e Mon Sep 17 00:00:00 2001 From: recy21 Date: Sun, 3 Dec 2023 21:46:49 +0100 Subject: [PATCH] (NOBIDS) Added a check to be sure price.init was called before using GetPrice --- price/price.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/price/price.go b/price/price.go index e66931823f..20a4b585af 100644 --- a/price/price.go +++ b/price/price.go @@ -220,6 +220,9 @@ func setPrice(a, b string, v float64) { } func GetPrice(a, b string) float64 { + if didInit < 1 { + logger.Fatal("using GetPrice without calling price.Init once") + } runOnceWg.Wait() pricesMu.Lock() defer pricesMu.Unlock()