From 36499e6779703f854edaeb9dd3347db9c60aafbb Mon Sep 17 00:00:00 2001 From: Michael Schmoock Date: Thu, 12 Nov 2020 17:29:50 +0100 Subject: [PATCH] fix: closer set to remote for onchain settlement Incase we have been offline while a channel was force closed on us we now set the 'closer' to 'remote' instead of null because this is by far the most probable reason. Changelog-None --- lightningd/channel.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lightningd/channel.c b/lightningd/channel.c index 0bf9d3d9f..9b88346de 100644 --- a/lightningd/channel.c +++ b/lightningd/channel.c @@ -434,9 +434,10 @@ void channel_set_state(struct channel *channel, /* set closer, if known */ if (state > CHANNELD_NORMAL && channel->closer == NUM_SIDES) { - if (reason == REASON_LOCAL) channel->closer = LOCAL; - if (reason == REASON_USER) channel->closer = LOCAL; - if (reason == REASON_REMOTE) channel->closer = REMOTE; + if (reason == REASON_LOCAL) channel->closer = LOCAL; + if (reason == REASON_USER) channel->closer = LOCAL; + if (reason == REASON_REMOTE) channel->closer = REMOTE; + if (reason == REASON_ONCHAIN) channel->closer = REMOTE; } /* use or update state_change_cause, if known */