hooks: Add the raw payload to the htlc_accepted call

Since we might soon be changing the payload it is a good idea to not just
expose the v0 payload, but also the raw payload for the plugin to
interpret. This might also include payloads that `lightningd` itself cannot
understand, but the plugin might.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
Suggested-by: Corné Plooy <@bitonic-cjp>
This commit is contained in:
Christian Decker
2019-02-21 14:39:50 +01:00
committed by Rusty Russell
parent 1561ffaea0
commit adb984dd45
3 changed files with 4 additions and 0 deletions

View File

@@ -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);