Skip to content

Commit

Permalink
fix: fix underflow under uint64
Browse files Browse the repository at this point in the history
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
  • Loading branch information
vincenzopalazzo committed Nov 20, 2022
1 parent 696772a commit d648501
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/plugin/metrics_one.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func (instance *MetricOne) onEvent(nameEvent string, lightning cln4go.Client) (*

minCap, found := listConfig["min-capacity-sat"]
if !found {
minCap = float64(-1)
minCap = float64(0)
} else {
minCap = minCap.(float64)
}
Expand All @@ -157,14 +157,14 @@ func (instance *MetricOne) onEvent(nameEvent string, lightning cln4go.Client) (*
// FIXME: add a map util to the the value of the default one
feeBase, found := listConfig["fee-base"]
if !found {
feeBase = float64(-1)
feeBase = float64(0)
} else {
feeBase = feeBase.(float64)
}

feePerSat, found := listConfig["fee-per-satoshi"]
if !found {
feePerSat = float64(-1)
feePerSat = float64(0)
} else {
feePerSat = feePerSat.(float64)
}
Expand Down

0 comments on commit d648501

Please sign in to comment.