mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-08 16:44:22 +01:00
lightningd: Restore forwarding of legacy onions.
Partial revert of 43a833e405
"lightningd: remove support for legacy onion format."; we restore the
ability to decode legacy onions for forwarding, but not to generate them.
(We don't accept them properly since making payment_secret compulsory
anyway, so no real change there!)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Removed: Protocol: ... but we still forward legacy HTLC onions for now.
This commit is contained in:
@@ -993,7 +993,15 @@ static void htlc_accepted_hook_serialize(struct htlc_accepted_hook_payload *p,
|
||||
|
||||
json_add_hex_talarr(s, "payload", rs->raw_payload);
|
||||
if (p->payload) {
|
||||
json_add_string(s, "type", "tlv");
|
||||
switch (p->payload->type) {
|
||||
case ONION_V0_PAYLOAD:
|
||||
json_add_string(s, "type", "legacy");
|
||||
break;
|
||||
|
||||
case ONION_TLV_PAYLOAD:
|
||||
json_add_string(s, "type", "tlv");
|
||||
break;
|
||||
}
|
||||
|
||||
if (p->payload->forward_channel)
|
||||
json_add_short_channel_id(s, "short_channel_id",
|
||||
|
||||
Reference in New Issue
Block a user