Skip to content

Commit cd03a7d

Browse files
committed
lightningd: add another stae check function.
In this case a "are we closed onchain". Signed-off-by: Rusty Russell <[email protected]>
1 parent bf3deb0 commit cd03a7d

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

lightningd/channel.h

+23
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,29 @@ static inline bool channel_state_failing_onchain(enum channel_state state)
601601
abort();
602602
}
603603

604+
static inline bool channel_state_funding_spent_onchain(enum channel_state state)
605+
{
606+
switch (state) {
607+
case CHANNELD_AWAITING_LOCKIN:
608+
case CHANNELD_NORMAL:
609+
case CHANNELD_AWAITING_SPLICE:
610+
case CLOSINGD_SIGEXCHANGE:
611+
case CHANNELD_SHUTTING_DOWN:
612+
case CLOSINGD_COMPLETE:
613+
case DUALOPEND_OPEN_INIT:
614+
case DUALOPEND_OPEN_COMMIT_READY:
615+
case DUALOPEND_OPEN_COMMITTED:
616+
case DUALOPEND_AWAITING_LOCKIN:
617+
case AWAITING_UNILATERAL:
618+
return false;
619+
case CLOSED:
620+
case FUNDING_SPEND_SEEN:
621+
case ONCHAIN:
622+
return true;
623+
}
624+
abort();
625+
}
626+
604627
static inline bool channel_state_pre_open(enum channel_state state)
605628
{
606629
switch (state) {

0 commit comments

Comments
 (0)