Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/src/main/java/to/bitkit/services/MigrationService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ class MigrationService @Inject constructor(
suspend fun markChannelRecoveryChecked() {
val key = stringPreferencesKey(RN_CHANNEL_RECOVERY_CHECKED_KEY)
rnMigrationStore.edit { it[key] = "true" }
Logger.info("markChannelRecoveryChecked", TAG)
}

suspend fun hasRNWalletData(): Boolean {
Expand Down Expand Up @@ -1488,6 +1489,7 @@ class MigrationService @Inject constructor(
}

if (monitors.isNotEmpty()) {
Logger.info("Found ${monitors.size} channel monitors", TAG)
pendingChannelMigration = PendingChannelMigration(
channelManager = managerData,
channelMonitors = monitors,
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/java/to/bitkit/viewmodels/WalletViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,10 @@ class WalletViewModel @Inject constructor(

val allMonitorsRetrieved = runCatching {
val allRetrieved = migrationService.fetchRNRemoteLdkData()
val channelMigration = buildChannelMigrationIfAvailable()
// don't overwrite channel manager, we only need the monitors for the sweep
val channelMigration = buildChannelMigrationIfAvailable()?.let {
ChannelDataMigration(channelManager = null, channelMonitors = it.channelMonitors)
}

if (channelMigration == null) {
Logger.info("No channel monitors found on RN backup", context = TAG)
Expand Down
Loading