From ea9faf6ff1dbc04c85185213368b314602ec29d9 Mon Sep 17 00:00:00 2001 From: lisa neigut Date: Tue, 19 Nov 2019 13:22:48 -0600 Subject: [PATCH] onion fixup: use enum for type, not length of packet We should be using the enum here, not the length of the payload --- common/sphinx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/sphinx.c b/common/sphinx.c index f95e6109b..872169bb1 100644 --- a/common/sphinx.c +++ b/common/sphinx.c @@ -147,7 +147,7 @@ static void sphinx_add_v0_hop(struct sphinx_path *path, towire_u32(&buf, outgoing_cltv); towire(&buf, padding, ARRAY_SIZE(padding)); assert(tal_bytelen(buf) == 32); - sphinx_add_raw_hop(path, pubkey, 0, buf); + sphinx_add_raw_hop(path, pubkey, SPHINX_V0_PAYLOAD, buf); } static void sphinx_add_tlv_hop(struct sphinx_path *path, @@ -156,7 +156,7 @@ static void sphinx_add_tlv_hop(struct sphinx_path *path, { u8 *tlvs = tal_arr(path, u8, 0); towire_tlvs(&tlvs, tlvs_tlv_payload, TLVS_TLV_PAYLOAD_ARRAY_SIZE, tlv); - sphinx_add_raw_hop(path, pubkey, tal_bytelen(tlvs), tlvs); + sphinx_add_raw_hop(path, pubkey, SPHINX_TLV_PAYLOAD, tlvs); } void sphinx_add_nonfinal_hop(struct sphinx_path *path,