sendpay: add payment_metadata argument.

And document the missing arguments.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-03-31 19:40:50 +10:30
parent 4718ee076c
commit 7f89763f9e
6 changed files with 29 additions and 10 deletions

View File

@@ -71,7 +71,8 @@ u8 *onion_final_hop(const tal_t *ctx,
struct amount_msat total_msat,
const struct pubkey *blinding,
const u8 *enctlv,
const struct secret *payment_secret)
const struct secret *payment_secret,
const u8 *payment_metadata)
{
struct tlv_tlv_payload *tlv = tlv_tlv_payload_new(tmpctx);
struct tlv_tlv_payload_payment_data tlv_pdata;
@@ -102,6 +103,7 @@ u8 *onion_final_hop(const tal_t *ctx,
tlv_pdata.total_msat = total_msat.millisatoshis; /* Raw: TLV convert */
tlv->payment_data = &tlv_pdata;
}
tlv->payment_metadata = cast_const(u8 *, payment_metadata);
#if EXPERIMENTAL_FEATURES
tlv->blinding_point = cast_const(struct pubkey *, blinding);
tlv->encrypted_recipient_data = cast_const(u8 *, enctlv);

View File

@@ -36,14 +36,15 @@ u8 *onion_nonfinal_hop(const tal_t *ctx,
const struct pubkey *blinding,
const u8 *enctlv);
/* Note that this can fail if we supply payment_secret and !use_tlv! */
/* Note that this can fail if we supply payment_secret or payment_metadata and !use_tlv! */
u8 *onion_final_hop(const tal_t *ctx,
struct amount_msat forward,
u32 outgoing_cltv,
struct amount_msat total_msat,
const struct pubkey *blinding,
const u8 *enctlv,
const struct secret *payment_secret);
const struct secret *payment_secret,
const u8 *payment_metadata);
/**
* onion_payload_length: measure payload length in decrypted onion.