From 848b1bbd93e32b02f6c3f240fec271c50554eb3a Mon Sep 17 00:00:00 2001 From: Pierre-Marie Padiou Date: Tue, 17 Sep 2024 10:05:21 +0200 Subject: [PATCH] Remove bad `return`s in `Syncing(Negotiating)` (#699) They were causing the inner function to return early and not prepend the `channel_reestablish`. --- .../kotlin/fr/acinq/lightning/channel/states/Syncing.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commonMain/kotlin/fr/acinq/lightning/channel/states/Syncing.kt b/src/commonMain/kotlin/fr/acinq/lightning/channel/states/Syncing.kt index aece9a49e..082029178 100644 --- a/src/commonMain/kotlin/fr/acinq/lightning/channel/states/Syncing.kt +++ b/src/commonMain/kotlin/fr/acinq/lightning/channel/states/Syncing.kt @@ -244,7 +244,7 @@ data class Syncing(val state: PersistedChannelState, val channelReestablishSent: ChannelAction.Message.Send(state.localShutdown), ChannelAction.Message.Send(closingSigned) ) - return Pair(nextState, actions) + Pair(nextState, actions) } else { // we start a new round of negotiation val closingTxProposed1 = if (state.closingTxProposed.last().isEmpty()) state.closingTxProposed else state.closingTxProposed + listOf(listOf()) @@ -253,7 +253,7 @@ data class Syncing(val state: PersistedChannelState, val channelReestablishSent: ChannelAction.Storage.StoreState(nextState), ChannelAction.Message.Send(state.localShutdown) ) - return Pair(nextState, actions) + Pair(nextState, actions) } is Closing, is Closed, is WaitForRemotePublishFutureCommitment -> unhandled(cmd) }