mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-19 05:44:12 +01:00
lightningd: remember depth of closing transaction.
We'll use this later to calculate deadlines for spending txs. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
9d5dfa7bdd
commit
80cd6f0afe
@ -248,6 +248,7 @@ struct channel *new_unsaved_channel(struct peer *peer,
|
||||
channel->old_feerate_timeout.ts.tv_nsec = 0;
|
||||
/* closer not yet known */
|
||||
channel->closer = NUM_SIDES;
|
||||
channel->close_blockheight = NULL;
|
||||
|
||||
/* BOLT-7b04b1461739c5036add61782d58ac490842d98b #9
|
||||
* | 222/223 | `option_dual_fund`
|
||||
@ -523,6 +524,7 @@ struct channel *new_channel(struct peer *peer, u64 dbid,
|
||||
list_head_init(&channel->inflights);
|
||||
|
||||
channel->closer = closer;
|
||||
channel->close_blockheight = NULL;
|
||||
channel->state_change_cause = reason;
|
||||
|
||||
/* Make sure we see any spends using this key */
|
||||
|
@ -242,6 +242,9 @@ struct channel {
|
||||
/* the one that initiated a bilateral close, NUM_SIDES if unknown. */
|
||||
enum side closer;
|
||||
|
||||
/* Block height we saw closing tx at */
|
||||
u32 *close_blockheight;
|
||||
|
||||
/* Last known state_change cause */
|
||||
enum state_change state_change_cause;
|
||||
|
||||
|
@ -909,6 +909,8 @@ enum watch_result onchaind_funding_spent(struct channel *channel,
|
||||
channel_record_open(channel, blkh, true);
|
||||
}
|
||||
|
||||
tal_free(channel->close_blockheight);
|
||||
channel->close_blockheight = tal_dup(channel, u32, &blockheight);
|
||||
|
||||
/* We could come from almost any state. */
|
||||
/* NOTE(mschmoock) above comment is wrong, since we failed above! */
|
||||
|
Loading…
Reference in New Issue
Block a user