channeld: Use local secret to generate bitcoin signature

This key will eventually migrate to the HSM, but for now it's in the
channeld so we generate the signature there.
This commit is contained in:
Christian Decker 2017-04-03 13:04:52 +09:30 committed by Rusty Russell
parent 20716ad29b
commit 9c07376dcf

View file

@ -145,9 +145,11 @@ static void send_announcement_signatures(struct peer *peer)
"HSM returned an invalid signature");
}
/* FIXME: Calculate bitcoin sig. */
memset(&peer->announcement_bitcoin_sigs[LOCAL], 0,
sizeof(peer->announcement_bitcoin_sigs[LOCAL]));
/* TODO(cdecker) Move this to the HSM once we store the
* funding_privkey there */
sign_hash(&peer->our_secrets.funding_privkey, &hash,
&peer->announcement_bitcoin_sigs[LOCAL]);
msg = towire_announcement_signatures(
tmpctx, &peer->channel_id, &peer->short_channel_ids[LOCAL],
&peer->announcement_node_sigs[LOCAL],