Skip to content

Commit d519a01

Browse files
committed
chore: use amountOnClose
1 parent d75a175 commit d519a01

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import kotlinx.coroutines.flow.stateIn
3737
import kotlinx.coroutines.flow.update
3838
import kotlinx.coroutines.launch
3939
import kotlinx.coroutines.withContext
40-
import org.lightningdevkit.ldknode.ChannelDetails
4140
import org.lightningdevkit.ldknode.Event
4241
import org.lightningdevkit.ldknode.PaymentId
4342
import org.lightningdevkit.ldknode.SpendableUtxo
@@ -49,6 +48,7 @@ import to.bitkit.data.resetPin
4948
import to.bitkit.di.BgDispatcher
5049
import to.bitkit.env.Env
5150
import to.bitkit.ext.WatchResult
51+
import to.bitkit.ext.amountOnClose
5252
import to.bitkit.ext.getClipboardText
5353
import to.bitkit.ext.getSatsPerVByteFor
5454
import to.bitkit.ext.maxSendableSat
@@ -218,7 +218,7 @@ class AppViewModel @Inject constructor(
218218
NewTransactionSheetDetails(
219219
type = NewTransactionSheetType.LIGHTNING,
220220
direction = NewTransactionSheetDirection.RECEIVED,
221-
sats = channel.getAmountSend(),
221+
sats = channel.amountOnClose.toLong(),
222222
),
223223
event = event
224224
)
@@ -1493,10 +1493,6 @@ class AppViewModel @Inject constructor(
14931493
setSendEffect(SendEffect.PaymentSuccess(details))
14941494
}
14951495

1496-
private fun ChannelDetails.getAmountSend(): Long {
1497-
return ((this.outboundCapacityMsat / MILLISATS + (this.unspendablePunishmentReserve ?: 0UL))).toLong()
1498-
}
1499-
15001496
companion object {
15011497
private const val TAG = "AppViewModel"
15021498
private const val SEND_AMOUNT_WARNING_THRESHOLD = 100.0

0 commit comments

Comments
 (0)