Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
440f2b1
feat: add PendingSweepBalance extension functions
jvsena42 Feb 25, 2026
14db4c9
fix: improve syncTransferStates for batched force-close sweeps
jvsena42 Feb 25, 2026
28f1993
fix: add ConnectionClosed sheet variant and UI
jvsena42 Feb 25, 2026
03c9cb5
fix: update handleChannelClosed in AppViewModel
jvsena42 Feb 25, 2026
71aeef6
test: add force-close sync tests
jvsena42 Feb 25, 2026
a179821
chore: lint
jvsena42 Feb 25, 2026
33a77ec
chore: lint
jvsena42 Feb 26, 2026
356a1d7
fix: mark closing transaction as transfer activity
jvsena42 Feb 26, 2026
0fff4aa
Merge branch 'fix/reimport-channel-monitor' into fix/channel-close-ui
jvsena42 Feb 26, 2026
7e284ef
fix: sheet size medium
jvsena42 Feb 26, 2026
4030583
Merge remote-tracking branch 'origin/fix/channel-close-ui' into fix/c…
jvsena42 Feb 27, 2026
9c4f80d
fix: settle COOP_CLOSE immediately
jvsena42 Feb 27, 2026
298bdf5
fix: balance calculation includes COOP_CLOSE whole they are unsettled…
jvsena42 Feb 27, 2026
d3af0c3
test: update coop close tests to settle immediately
jvsena42 Feb 27, 2026
793e0b9
feat: add claimableAtHeight to TransferEntity
jvsena42 Feb 27, 2026
f4849a4
feat: pass claimableAtHeight when creating force close transfer
jvsena42 Feb 27, 2026
8777244
chore: create helpers to display the duration
jvsena42 Feb 27, 2026
0aa2049
feat: update banner for dynamic title
jvsena42 Feb 27, 2026
6af900c
fix: show dynamic duration for force-close
jvsena42 Feb 27, 2026
ae0f027
fix: suppress receive sheet for transfers
jvsena42 Feb 27, 2026
78efaf5
fix: claimableAtHeight type
jvsena42 Feb 27, 2026
5480492
chore: migration
jvsena42 Feb 27, 2026
37235c3
fix: claimableAtHeight type
jvsena42 Feb 27, 2026
dafdea3
test: BlockTimer helper tests
jvsena42 Feb 27, 2026
aad07e4
chore: lint
jvsena42 Feb 27, 2026
c1715b4
refactor: move force close duration calculation to TransferRepo.kt
jvsena42 Feb 27, 2026
94c86a3
fix: subtract coop closing amount from balanceInTransferToSavings
jvsena42 Feb 27, 2026
8302993
fix: transfer banner visibility
jvsena42 Feb 27, 2026
ed56df9
fix: check if this transaction is a pending sweep from a channel closure
jvsena42 Feb 27, 2026
e56d56a
Merge branch 'fix/reimport-channel-monitor' into fix/channel-close-ui
jvsena42 Feb 27, 2026
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
Prev Previous commit
Next Next commit
chore: lint
  • Loading branch information
jvsena42 committed Feb 27, 2026
commit aad07e44873bbbd74a0a0fa9f3b60492846e6ccd
1 change: 1 addition & 0 deletions app/src/main/java/to/bitkit/repositories/TransferRepo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class TransferRepo @Inject constructor(
) {
val activeTransfers: Flow<List<TransferEntity>> = transferDao.getActiveTransfers()

@Suppress("LongParameterList")
suspend fun createTransfer(
type: TransferType,
amountSats: Long,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package to.bitkit.ui.screens.wallets

import android.content.Context
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import dagger.hilt.android.lifecycle.HiltViewModel
import dagger.hilt.android.qualifiers.ApplicationContext
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
Expand All @@ -11,10 +13,8 @@ import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.update
import kotlinx.coroutines.launch
import to.bitkit.data.SettingsStore
import android.content.Context
import dagger.hilt.android.qualifiers.ApplicationContext
import to.bitkit.R
import to.bitkit.data.SettingsStore
import to.bitkit.models.ActivityBannerType
import to.bitkit.models.BannerItem
import to.bitkit.models.Suggestion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import to.bitkit.data.entities.TransferEntity
import to.bitkit.ext.amountSats
import to.bitkit.ext.channelId
import to.bitkit.ext.totalNextOutboundHtlcLimitSats
import to.bitkit.utils.BlockTimeHelpers
import to.bitkit.models.BalanceState
import to.bitkit.models.TransferType
import to.bitkit.models.safe
import to.bitkit.repositories.LightningRepo
import to.bitkit.repositories.TransferRepo
import to.bitkit.utils.BlockTimeHelpers
import to.bitkit.utils.Logger
import to.bitkit.utils.jsonLogOf
import javax.inject.Inject
Expand Down
11 changes: 8 additions & 3 deletions app/src/main/java/to/bitkit/utils/BlockTimeHelpers.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@ package to.bitkit.utils

import kotlin.math.roundToInt

@Suppress("MagicNumber")
object BlockTimeHelpers {
private const val BLOCK_TIME_MINUTES = 10
private const val MINUTES_PER_HOUR = 60.0
private const val HOURS_PER_DAY = 24.0
private const val BLOCKS_PER_DAY = 143
private const val REORG_PROTECTION_BLOCKS = 6

fun getDurationForBlocks(blocks: Int): String = when {
blocks > 143 -> "${(blocks * BLOCK_TIME_MINUTES / 60.0 / 24.0).roundToInt()}d"
blocks > 6 -> "${(blocks * BLOCK_TIME_MINUTES / 60.0).roundToInt()}h"
blocks > BLOCKS_PER_DAY -> "${(blocks * BLOCK_TIME_MINUTES / MINUTES_PER_HOUR / HOURS_PER_DAY).roundToInt()}d"
blocks > REORG_PROTECTION_BLOCKS -> "${(blocks * BLOCK_TIME_MINUTES / MINUTES_PER_HOUR).roundToInt()}h"
else -> "${blocks * BLOCK_TIME_MINUTES}m"
}

fun blocksRemaining(targetHeight: UInt, currentHeight: UInt): Int =
maxOf(0, (targetHeight.toInt() - currentHeight.toInt()))
}
}