From 3c8af4dd880510261e2a1238dd6c468039ef8967 Mon Sep 17 00:00:00 2001 From: KforG Date: Fri, 1 Mar 2024 18:02:28 +0100 Subject: [PATCH] Simplify p2pool fee error --- pools/p2pool.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pools/p2pool.go b/pools/p2pool.go index 7f9bf597..9be6a7d9 100644 --- a/pools/p2pool.go +++ b/pools/p2pool.go @@ -71,17 +71,15 @@ func (p *P2Pool) GetFee() (fee float64) { err := util.GetJson(fmt.Sprintf("%slocal_stats", ping.Selected.P2PoolURL), &jsonPayload) if err != nil { logging.Warnf("Unable to fetch p2pool fee: %s", err.Error()) - fee = 2.0 + return 2.0 } fee, ok := jsonPayload["fee"].(float64) if !ok { - fee = 2.0 - return fee + return 2.0 } donationFee, ok := jsonPayload["donation_proportion"].(float64) if !ok { - fee = 2.0 - return fee + return 2.0 } fee += donationFee p.LastFetchedFee = time.Now()