mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-19 05:44:12 +01:00
hsmd: add the check for channel_announcement
This commit is contained in:
parent
274f156b28
commit
bcb287f89b
11
hsmd/hsmd.c
11
hsmd/hsmd.c
@ -630,6 +630,9 @@ static struct io_plan *handle_cannouncement_sig(struct io_conn *conn,
|
|||||||
* yourself should go ahead an implement. Sometimes they're deceptive
|
* yourself should go ahead an implement. Sometimes they're deceptive
|
||||||
* quagmires which will cause you nothing but grief. You decide! */
|
* quagmires which will cause you nothing but grief. You decide! */
|
||||||
|
|
||||||
|
/*~ Christian uses TODO(cdecker) or FIXME(cdecker), but I'm sure he won't
|
||||||
|
* mind if you fix this for him! */
|
||||||
|
|
||||||
/* FIXME: We should cache these. */
|
/* FIXME: We should cache these. */
|
||||||
get_channel_seed(&c->id, c->dbid, &channel_seed);
|
get_channel_seed(&c->id, c->dbid, &channel_seed);
|
||||||
derive_funding_key(&channel_seed, &funding_pubkey, &funding_privkey);
|
derive_funding_key(&channel_seed, &funding_pubkey, &funding_privkey);
|
||||||
@ -645,10 +648,10 @@ static struct io_plan *handle_cannouncement_sig(struct io_conn *conn,
|
|||||||
"bad cannounce length %zu",
|
"bad cannounce length %zu",
|
||||||
tal_count(ca));
|
tal_count(ca));
|
||||||
|
|
||||||
/*~ Christian uses TODO(cdecker), but I'm sure he won't mind if you fix
|
if (fromwire_peektype(ca) != WIRE_CHANNEL_ANNOUNCEMENT)
|
||||||
* this for him! */
|
return bad_req_fmt(conn, c, msg_in,
|
||||||
/* TODO(cdecker) Check that this is actually a valid
|
"Invalid channel announcement");
|
||||||
* channel_announcement */
|
|
||||||
node_key(&node_pkey, NULL);
|
node_key(&node_pkey, NULL);
|
||||||
sha256_double(&hash, ca + offset, tal_count(ca) - offset);
|
sha256_double(&hash, ca + offset, tal_count(ca) - offset);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user