Skip to content

Commit

Permalink
wallet - properly set state field in melt responses
Browse files Browse the repository at this point in the history
  • Loading branch information
elnosh committed Aug 5, 2024
1 parent 18811ac commit c0cbfda
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions wallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,12 @@ func (w *Wallet) Melt(invoice string, mintURL string) (*nut05.PostMeltQuoteBolt1
// if state field is present, use that instead of paid
if meltBolt11Response.State != nut05.Unknown {
paid = meltBolt11Response.State == nut05.Paid
} else {
if paid {
meltBolt11Response.State = nut05.Paid
} else {
meltBolt11Response.State = nut05.Unpaid
}
}
if !paid {
// save proofs if invoice was not paid
Expand Down

0 comments on commit c0cbfda

Please sign in to comment.