nip60: slight improvement to lightning melt-mint flow.

This commit is contained in:
fiatjaf
2025-01-28 23:28:13 -03:00
parent 2244740f61
commit 794561a3b3
4 changed files with 89 additions and 63 deletions

View File

@@ -158,12 +158,13 @@ found:
updatedTokens = append(updatedTokens, token)
}
if err := changeToken.toEvent(ctx, w.wl.kr, w.Identifier, changeToken.event); err != nil {
return "", fmt.Errorf("failed to make change token: %w", err)
if len(changeToken.Proofs) > 0 {
if err := changeToken.toEvent(ctx, w.wl.kr, w.Identifier, changeToken.event); err != nil {
return "", fmt.Errorf("failed to make change token: %w", err)
}
w.wl.Changes <- *changeToken.event
w.Tokens = append(updatedTokens, changeToken)
}
w.wl.Changes <- *changeToken.event
w.Tokens = append(updatedTokens, changeToken)
// serialize token we're sending out
token, err := cashu.NewTokenV4(proofsToSend, target.mint, cashu.Sat, true)