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
This commit is contained in:
Michael Schmoock
2020-11-12 17:29:50 +01:00
committed by neil saitug
parent 3e42d08c89
commit 36499e6779

View File

@@ -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 */