From 7439267a7bf92c4096f8fc92cd2b9f9b33b29eb4 Mon Sep 17 00:00:00 2001 From: Dominique Padiou <5765435+dpad85@users.noreply.github.com> Date: Mon, 25 Nov 2024 13:29:00 +0100 Subject: [PATCH] (legacy) Relax rule for channel force-close in migration --- .../phoenix/legacy/main/MigrationFragmentDialog.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/phoenix-legacy/src/main/kotlin/fr/acinq/phoenix/legacy/main/MigrationFragmentDialog.kt b/phoenix-legacy/src/main/kotlin/fr/acinq/phoenix/legacy/main/MigrationFragmentDialog.kt index b1aa9fde9..c2aa0361c 100644 --- a/phoenix-legacy/src/main/kotlin/fr/acinq/phoenix/legacy/main/MigrationFragmentDialog.kt +++ b/phoenix-legacy/src/main/kotlin/fr/acinq/phoenix/legacy/main/MigrationFragmentDialog.kt @@ -289,7 +289,7 @@ class MigrationDialogViewModel : ViewModel() { state.value = MigrationScreenState.Complete(swapInAddress, channelsPublicationStatusMap.keys) // pause then update preferences to switch to the new app - delay(3_000) + delay(2_000) LegacyPrefsDatastore.savePrefsMigrationExpected(context, true) LegacyPrefsDatastore.saveDataMigrationExpected(context, true) LegacyPrefsDatastore.saveHasMigratedFromLegacy(context, true) @@ -304,12 +304,12 @@ class MigrationDialogViewModel : ViewModel() { return channels.any { when (val data = it.data()) { is DATA_CLOSING -> { - data.remoteCommitPublished().isDefined - || !data.revokedCommitPublished().isEmpty - || !data.customRemoteCommitPublished().isEmpty - || data.futureRemoteCommitPublished().isDefined - || data.localCommitPublished().isDefined - || data.nextRemoteCommitPublished().isDefined + (data.remoteCommitPublished().nonEmpty() && data.remoteCommitPublished().get().irrevocablySpent().isEmpty) // potentially a remote close but remote commit is not confirmed + || data.revokedCommitPublished().nonEmpty() + || data.customRemoteCommitPublished().nonEmpty() + || data.futureRemoteCommitPublished().nonEmpty() + || data.localCommitPublished().nonEmpty() + || data.nextRemoteCommitPublished().nonEmpty() } else -> false }