Skip to content

Commit

Permalink
fix get exchange rate panic (#703)
Browse files Browse the repository at this point in the history
  • Loading branch information
lazynina authored Nov 22, 2024
1 parent 6f666cc commit 1416a91
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion routes/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ func (fes *APIServer) GetExchangeRate(ww http.ResponseWriter, rr *http.Request)
nanosPerETH := fes.GetNanosFromETH(big.NewFloat(1), 0)

usdCentsPerDeSoExchangeRate := fes.GetExchangeDeSoPrice()
satoshisPerUnit := lib.NanosPerUnit / fes.GetNanosFromSats(1, 0)
nanosFromSats := fes.GetNanosFromSats(1, 0)
satoshisPerUnit := uint64(0)
if nanosFromSats != 0 {
satoshisPerUnit = lib.NanosPerUnit / fes.GetNanosFromSats(1, 0)
}

res := &GetExchangeRateResponse{
// BTC
Expand Down

0 comments on commit 1416a91

Please sign in to comment.