diff --git a/common/sphinx.c b/common/sphinx.c index 40ed4c2a0..48e4779b2 100644 --- a/common/sphinx.c +++ b/common/sphinx.c @@ -434,6 +434,8 @@ struct route_step *process_onionpacket( deserialize_hop_data(&step->hop_data, paddedheader); memcpy(&step->next->mac, step->hop_data.hmac, SECURITY_PARAMETER); + step->raw_payload = tal_dup_arr(step, u8, paddedheader + 1, + HOP_DATA_SIZE - 1 - HMAC_SIZE, 0); memcpy(&step->next->routinginfo, paddedheader + HOP_DATA_SIZE, ROUTING_INFO_SIZE); diff --git a/common/sphinx.h b/common/sphinx.h index e1f6fb5a5..e9f475b29 100644 --- a/common/sphinx.h +++ b/common/sphinx.h @@ -77,6 +77,7 @@ struct route_step { enum route_next_case nextcase; struct onionpacket *next; struct hop_data hop_data; + u8 *raw_payload; }; /** diff --git a/lightningd/peer_htlcs.c b/lightningd/peer_htlcs.c index 76c3a20d7..22ef19d94 100644 --- a/lightningd/peer_htlcs.c +++ b/lightningd/peer_htlcs.c @@ -718,6 +718,7 @@ static void htlc_accepted_hook_serialize(struct htlc_accepted_hook_payload *p, s32 expiry = hin->cltv_expiry, blockheight = p->ld->topology->tip->height; json_object_start(s, "onion"); + json_add_hex_talarr (s, "payload", rs->raw_payload); if (rs->hop_data.realm == 0x00) { json_object_start(s, "per_hop_v0"); json_add_hex(s, "realm", &rs->hop_data.realm, 1);