mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
channel_fallen_behind: break out functionality into two methods
We'll need this for moving 'waiting for locked' into dualopend.
This commit is contained in:
parent
fd2e16f8bc
commit
9cb2a15858
@ -261,16 +261,8 @@ static void peer_got_shutdown(struct channel *channel, const u8 *msg)
|
||||
wallet_channel_save(ld->wallet, channel);
|
||||
}
|
||||
|
||||
static void channel_fail_fallen_behind(struct channel *channel, const u8 *msg)
|
||||
void channel_fallen_behind(struct channel *channel, const u8 *msg)
|
||||
{
|
||||
if (!fromwire_channeld_fail_fallen_behind(channel, msg,
|
||||
cast_const2(struct pubkey **,
|
||||
&channel->future_per_commitment_point))) {
|
||||
channel_internal_error(channel,
|
||||
"bad channel_fail_fallen_behind %s",
|
||||
tal_hex(tmpctx, msg));
|
||||
return;
|
||||
}
|
||||
|
||||
/* per_commitment_point is NULL if option_static_remotekey, but we
|
||||
* use its presence as a flag so set it any valid key in that case. */
|
||||
@ -293,6 +285,21 @@ static void channel_fail_fallen_behind(struct channel *channel, const u8 *msg)
|
||||
"Awaiting unilateral close");
|
||||
}
|
||||
|
||||
static void
|
||||
channel_fail_fallen_behind(struct channel *channel, const u8 *msg)
|
||||
{
|
||||
if (!fromwire_channeld_fail_fallen_behind(channel, msg,
|
||||
cast_const2(struct pubkey **,
|
||||
&channel->future_per_commitment_point))) {
|
||||
channel_internal_error(channel,
|
||||
"bad channel_fail_fallen_behind %s",
|
||||
tal_hex(tmpctx, msg));
|
||||
return;
|
||||
}
|
||||
|
||||
channel_fallen_behind(channel, msg);
|
||||
}
|
||||
|
||||
static void peer_start_closingd_after_shutdown(struct channel *channel,
|
||||
const u8 *msg,
|
||||
const int *fds)
|
||||
|
@ -38,4 +38,7 @@ void channel_record_open(struct channel *channel);
|
||||
/* Forget a channel. Deletes the channel and handles all
|
||||
* associated waiting commands, if present. Notifies peer if available */
|
||||
void forget_channel(struct channel *channel, const char *err_msg);
|
||||
|
||||
/* A channel has unrecoverably fallen behind */
|
||||
void channel_fallen_behind(struct channel *channel, const u8 *msg);
|
||||
#endif /* LIGHTNING_LIGHTNINGD_CHANNEL_CONTROL_H */
|
||||
|
Loading…
Reference in New Issue
Block a user