From 4d44d11ece5c1fbeff70b4a99c781d4c8ddbe73a Mon Sep 17 00:00:00 2001 From: Elle Mouton Date: Mon, 30 Sep 2024 10:32:25 +0200 Subject: [PATCH] rpcserver: use SetBit helper for setting Bolt11 blinded bit This commit uses the new SetBit helper for setting the Bolt11 route blinding required bit in a generated invoice. This helper will take care of setting the dependent bits of the feature bit (namely the route blinding and TLV feature bits and will use the required variant of both). --- docs/release-notes/release-notes-0.19.0.md | 4 ++++ rpcserver.go | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/release-notes-0.19.0.md b/docs/release-notes/release-notes-0.19.0.md index a0262b0f5..675ab7cf4 100644 --- a/docs/release-notes/release-notes-0.19.0.md +++ b/docs/release-notes/release-notes-0.19.0.md @@ -27,6 +27,10 @@ cause a nil pointer dereference during the probing of a payment request that does not contain a payment address. +* [Use the required route blinding + feature-bit](https://github.com/lightningnetwork/lnd/pull/9143) for invoices + containing blinded paths. + # New Features ## Functional Enhancements ## RPC Additions diff --git a/rpcserver.go b/rpcserver.go index c9edf852a..1cce42f2f 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -6055,8 +6055,9 @@ func (r *rpcServer) AddInvoice(ctx context.Context, // understand the new BOLT 11 tagged field // containing the blinded path, so we switch // the bit to required. - v.Unset(lnwire.Bolt11BlindedPathsOptional) - v.Set(lnwire.Bolt11BlindedPathsRequired) + v = feature.SetBit( + v, lnwire.Bolt11BlindedPathsRequired, + ) } return v