diff --git a/app/controllers/services/lightning_controller.rb b/app/controllers/services/lightning_controller.rb index 4dd9607..573d155 100644 --- a/app/controllers/services/lightning_controller.rb +++ b/app/controllers/services/lightning_controller.rb @@ -86,6 +86,10 @@ class Services::LightningController < ApplicationController end end + # Handle an edge case where lndhub.go includes a failed payment in the + # list, which wasn't actually booked + txs.reject!{ |tx| tx["type"] == "paid_invoice" && tx["payment_preimage"].blank? } + txs.sort{ |a,b| b["datetime"] <=> a["datetime"] } end end