df: helper to find the last (most recent) inflight for a channel

This commit is contained in:
niftynei 2021-01-19 19:27:45 -06:00 committed by neil saitug
parent 628f9df320
commit 95e81ce82c

View File

@ -56,6 +56,23 @@ unsaved_channel_disconnect(struct channel *channel,
} }
/* FIXME: remove when used */
struct channel_inflight *
channel_current_inflight(struct channel *channel);
struct channel_inflight *
channel_current_inflight(struct channel *channel)
{
struct channel_inflight *inflight;
/* The last inflight should always be the one in progress */
inflight = list_tail(&channel->inflights,
struct channel_inflight,
list);
if (inflight)
assert(bitcoin_txid_eq(&channel->funding_txid,
&inflight->funding->txid));
return inflight;
}
static void handle_signed_psbt(struct lightningd *ld, static void handle_signed_psbt(struct lightningd *ld,
struct subd *dualopend, struct subd *dualopend,
const struct wally_psbt *psbt, const struct wally_psbt *psbt,