Skip to content

Commit

Permalink
Fix fee ppm calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
rkfg committed Dec 17, 2022
1 parent b5960e8 commit 4116c30
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion payment.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func (r *regolancer) pay(ctx context.Context, amount int64, minAmount int64,
return fmt.Errorf("error: %s @ %d", result.Failure.Code.String(), result.Failure.FailureSourceIndex)
} else {
log.Printf("Success! Paid %s in fees, %s ppm",
formatFee(result.Route.TotalFeesMsat), formatFeePPM(result.Route.TotalAmtMsat, result.Route.TotalFeesMsat))
formatFee(result.Route.TotalFeesMsat), formatFeePPM(result.Route.TotalAmtMsat-result.Route.TotalFeesMsat, result.Route.TotalFeesMsat))
if r.statFilename != "" {

l := lock()
Expand Down
2 changes: 1 addition & 1 deletion routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func (r *regolancer) printRoute(ctx context.Context, route *lnrpc.Route) {
}
errs := ""
fmt.Printf("%s %s sat | %s ppm\n", faintWhiteColor("Total fee:"),
formatFee(route.TotalFeesMsat), formatFeePPM(route.TotalAmtMsat, route.TotalFeesMsat))
formatFee(route.TotalFeesMsat), formatFeePPM(route.TotalAmtMsat-route.TotalFeesMsat, route.TotalFeesMsat))
for i, hop := range route.Hops {
cached := ""
if params.NodeCacheInfo {
Expand Down

0 comments on commit 4116c30

Please sign in to comment.