mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-30 18:43:42 +02:00
zpay32: add functional opt to error out on unknown feature bit
This commit adds two functional options to the zpay32.Decode function. `WithKnownFeatureBits` allows the caller to overwrite the default set of known feature bits used by the function. `WithErrorOnUnknownFeatureBit` allows the caller to instruct the function to error out if the invoice that is decoded contaijns unknown feature bits. We then use this new error-out option from the `rpcServer`'s `extractPaymentIntent` method.
This commit is contained in:
@ -5210,6 +5210,7 @@ func (r *rpcServer) extractPaymentIntent(rpcPayReq *rpcPaymentRequest) (rpcPayme
|
||||
if rpcPayReq.PaymentRequest != "" {
|
||||
payReq, err := zpay32.Decode(
|
||||
rpcPayReq.PaymentRequest, r.cfg.ActiveNetParams.Params,
|
||||
zpay32.WithErrorOnUnknownFeatureBit(),
|
||||
)
|
||||
if err != nil {
|
||||
return payIntent, err
|
||||
|
Reference in New Issue
Block a user