mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
secrets: peer_sign_theircommit() helper.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
90e381f750
commit
871e4d5172
@ -41,6 +41,18 @@ struct peer_secrets {
|
||||
struct sha256 revocation_seed;
|
||||
};
|
||||
|
||||
void peer_sign_theircommit(const struct peer *peer, struct signature *sig)
|
||||
{
|
||||
/* Commit tx only has one input: that of the anchor. */
|
||||
sign_tx_input(peer->dstate->secpctx,
|
||||
peer->them.commit, 0,
|
||||
peer->anchor.redeemscript,
|
||||
tal_count(peer->anchor.redeemscript),
|
||||
&peer->secrets->commit,
|
||||
&peer->us.commitkey,
|
||||
sig);
|
||||
}
|
||||
|
||||
static void new_keypair(struct lightningd_state *dstate,
|
||||
struct privkey *privkey, struct pubkey *pubkey)
|
||||
{
|
||||
|
@ -12,6 +12,8 @@ struct sha256;
|
||||
void privkey_sign(struct peer *peer, const void *src, size_t len,
|
||||
struct signature *sig);
|
||||
|
||||
void peer_sign_theircommit(const struct peer *peer, struct signature *sig);
|
||||
|
||||
void peer_secrets_init(struct peer *peer);
|
||||
|
||||
void peer_get_revocation_hash(const struct peer *peer, u64 index,
|
||||
|
Loading…
Reference in New Issue
Block a user