lightningd: save last htlc sigs.

This belongs in the db, but until then...

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2017-08-18 14:13:53 +09:30
parent b6d7ad0614
commit edd27d21b5
3 changed files with 5 additions and 0 deletions

View File

@ -522,6 +522,7 @@ void add_peer(struct lightningd *ld, u64 unique_id,
peer->channel_info = NULL;
peer->last_tx = NULL;
peer->last_sig = NULL;
peer->last_htlc_sigs = NULL;
peer->last_was_revoke = false;
peer->last_sent_commit = NULL;
peer->remote_shutdown_scriptpubkey = NULL;

View File

@ -79,6 +79,7 @@ struct peer {
/* Last tx they gave us (if any). */
struct bitcoin_tx *last_tx;
secp256k1_ecdsa_signature *last_sig;
secp256k1_ecdsa_signature *last_htlc_sigs;
/* Keys for channel. */
struct channel_info *channel_info;

View File

@ -1071,6 +1071,9 @@ int peer_got_commitsig(struct peer *peer, const u8 *msg)
return -1;
peer_last_tx(peer, tx, &commit_sig);
/* FIXME: Put these straight in the db! */
tal_free(peer->last_htlc_sigs);
peer->last_htlc_sigs = tal_steal(peer, htlc_sigs);
/* Tell it we've committed, and to go ahead with revoke. */
msg = towire_channel_got_commitsig_reply(msg);