diff --git a/src/commonMain/kotlin/fr/acinq/lightning/io/Peer.kt b/src/commonMain/kotlin/fr/acinq/lightning/io/Peer.kt index 6bbb82d9c..68191f2d8 100644 --- a/src/commonMain/kotlin/fr/acinq/lightning/io/Peer.kt +++ b/src/commonMain/kotlin/fr/acinq/lightning/io/Peer.kt @@ -229,7 +229,6 @@ class Peer( } logger.info { "restored ${channelIds.size} channels" } launch { watchSwapInWallet() } - launch { watchLiquidityPolicyChanges() } launch { // If we have some htlcs that have timed out, we may need to close channels to ensure we don't lose funds. // But maybe we were offline for too long and it is why our peer couldn't settle these htlcs in time. @@ -392,20 +391,6 @@ class Peer( } } - private suspend fun watchLiquidityPolicyChanges() { - nodeParams.liquidityPolicy.collect { - val walletState = swapInWallet.walletStateFlow.first() - if (walletState.consistent) { - logger.info { "liquidity policy changed, retrying swaps" } - val currentBlockHeight = currentTipFlow.filterNotNull().first().first - input.send(WalletCommand.TrySwapIn(currentBlockHeight, walletState, walletParams.swapInConfirmations, isMigrationFromLegacyApp)) - } else { - // If the wallet is inconsistent, it should become consistent soon, which will trigger the normal swap flow. - logger.info { "liquidity policy changed, waiting for wallet to be consistent" } - } - } - } - suspend fun send(cmd: PeerCommand) { input.send(cmd) }