mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 22:45:27 +01:00
common/onion_decode: update to latest BOLT spec, reject encrypted_recipient_data with both scid and node.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
4a36edf7c1
commit
f1d78ff35a
2 changed files with 8 additions and 1 deletions
2
Makefile
2
Makefile
|
@ -26,7 +26,7 @@ CCANDIR := ccan
|
|||
|
||||
# Where we keep the BOLT RFCs
|
||||
BOLTDIR := ../bolts/
|
||||
DEFAULT_BOLTVERSION := 0bdaa8b9f65fc82a178d0d8722d352f2320b02f4
|
||||
DEFAULT_BOLTVERSION := 78e5a6b066d3a8e235931dfc06aa325337874749
|
||||
# Can be overridden on cmdline.
|
||||
BOLTVERSION := $(DEFAULT_BOLTVERSION)
|
||||
|
||||
|
|
|
@ -298,6 +298,8 @@ struct onion_payload *onion_decode(const tal_t *ctx,
|
|||
* - MUST return an error if:
|
||||
* - `encrypted_recipient_data.allowed_features.features`
|
||||
* contains an unknown feature bit (even if it is odd).
|
||||
* - `encrypted_recipient_data` contains both
|
||||
* `short_channel_id` and `next_node_id`.
|
||||
* - the payment uses a feature not included in
|
||||
* `encrypted_recipient_data.allowed_features.features`.
|
||||
*/
|
||||
|
@ -308,6 +310,11 @@ struct onion_payload *onion_decode(const tal_t *ctx,
|
|||
goto field_bad;
|
||||
}
|
||||
|
||||
if (enc->short_channel_id && enc->next_node_id) {
|
||||
*failtlvtype = TLV_PAYLOAD_ENCRYPTED_RECIPIENT_DATA;
|
||||
goto field_bad;
|
||||
}
|
||||
|
||||
if (!p->final) {
|
||||
if (!handle_blinded_forward(p, amount_in, cltv_expiry,
|
||||
p->tlv, enc, failtlvtype))
|
||||
|
|
Loading…
Add table
Reference in a new issue