multi: add IsBlinded to lnrpc.Invoice for nicer UX

The BlindedPathConfig struct is nice for invoice creation but when we
use the Invoice message for viewing an invoice, it would be nicer to see
an "is_blinded" field.
This commit is contained in:
Elle Mouton
2024-08-08 14:18:07 +02:00
parent 5a84ca8032
commit 5e84ba92af
9 changed files with 1226 additions and 1175 deletions

View File

@@ -489,6 +489,15 @@ func (i *Invoice) IsAMP() bool {
)
}
// IsBlinded returns true if the invoice contains blinded paths.
func (i *Invoice) IsBlinded() bool {
if i.Terms.Features == nil {
return false
}
return i.Terms.Features.IsSet(lnwire.Bolt11BlindedPathsRequired)
}
// HtlcState defines the states an htlc paying to an invoice can be in.
type HtlcState uint8