Skip to content

Commit

Permalink
Simplify p2pool fee error
Browse files Browse the repository at this point in the history
  • Loading branch information
KforG committed Mar 1, 2024
1 parent d292337 commit 3c8af4d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pools/p2pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 3c8af4d

Please sign in to comment.