mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-17 19:03:42 +01:00
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:
parent
b6d7ad0614
commit
edd27d21b5
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user