mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-05 23:24:21 +01:00
common/onion_decode: put the path_id into onion_payload->payment_secret.
And check it in invoice.c, insead of a hack where we compare against invhash. Restore checking, too. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
595fbd2a19
commit
c6f50220e1
@@ -285,9 +285,14 @@ struct onion_payload *onion_decode(const tal_t *ctx,
|
||||
goto field_bad;
|
||||
}
|
||||
|
||||
/* Blinded paths have no payment secret or metadata:
|
||||
* we use the path_id for that. */
|
||||
p->payment_secret = NULL;
|
||||
/* We stash path_id (if present and valid!) in payment_secret */
|
||||
if (tal_bytelen(enc->path_id) == sizeof(*p->payment_secret)) {
|
||||
p->payment_secret = tal_steal(p,
|
||||
(struct secret *)enc->path_id);
|
||||
} else
|
||||
p->payment_secret = NULL;
|
||||
|
||||
/* FIXME: if we supported metadata, it would also be in path_id */
|
||||
p->payment_metadata = NULL;
|
||||
return p;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user