Skip to content

Commit

Permalink
offers: use node_id not scid inside blinded path.
Browse files Browse the repository at this point in the history
Without this, it was broken because our peer will no longer forward
via scids for private channels.  We could use the scid alias, but the
node id is right at hand.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and endothermicdev committed May 15, 2024
1 parent 847208f commit 8b5bf71
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plugins/offers_invreq_hook.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "config.h"
#include <bitcoin/chainparams.h>
#include <bitcoin/preimage.h>
#include <ccan/cast/cast.h>
#include <ccan/tal/str/str.h>
#include <common/bech32_util.h>
#include <common/blindedpath.h>
Expand Down Expand Up @@ -258,15 +259,15 @@ static u8 *create_enctlv(const tal_t *ctx,
/* in and out */
struct privkey *blinding,
const struct pubkey *node_id,
struct short_channel_id *next_scid,
const struct pubkey *next_node_id,
struct tlv_encrypted_data_tlv_payment_relay *payment_relay,
struct tlv_encrypted_data_tlv_payment_constraints *payment_constraints,
u8 *path_secret,
struct pubkey *node_alias)
{
struct tlv_encrypted_data_tlv *tlv = tlv_encrypted_data_tlv_new(tmpctx);

tlv->short_channel_id = next_scid;
tlv->next_node_id = cast_const(struct pubkey *, next_node_id);
tlv->path_id = path_secret;
tlv->payment_relay = payment_relay;
tlv->payment_constraints = payment_constraints;
Expand Down Expand Up @@ -418,7 +419,7 @@ static struct command_result *listincoming_done(struct command *cmd,
= create_enctlv(hops[0],
&blinding,
&best->id,
&best->scid,
&id,
&relay, &constraints,
NULL,
&hops[0]->blinded_node_id);
Expand Down

0 comments on commit 8b5bf71

Please sign in to comment.