From 1a1acebea4135bec606f501f39420bbcc49b66cc Mon Sep 17 00:00:00 2001 From: t-bast Date: Wed, 21 Jun 2023 09:07:32 +0200 Subject: [PATCH] Don't retry on liquidity policy changes --- .../kotlin/fr/acinq/lightning/io/Peer.kt | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/commonMain/kotlin/fr/acinq/lightning/io/Peer.kt b/src/commonMain/kotlin/fr/acinq/lightning/io/Peer.kt index 996f9d6c1..e4a8ea29f 100644 --- a/src/commonMain/kotlin/fr/acinq/lightning/io/Peer.kt +++ b/src/commonMain/kotlin/fr/acinq/lightning/io/Peer.kt @@ -226,7 +226,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. @@ -389,20 +388,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) }