@@ -37,7 +37,6 @@ import kotlinx.coroutines.flow.stateIn
3737import kotlinx.coroutines.flow.update
3838import kotlinx.coroutines.launch
3939import kotlinx.coroutines.withContext
40- import org.lightningdevkit.ldknode.ChannelDetails
4140import org.lightningdevkit.ldknode.Event
4241import org.lightningdevkit.ldknode.PaymentId
4342import org.lightningdevkit.ldknode.SpendableUtxo
@@ -49,6 +48,7 @@ import to.bitkit.data.resetPin
4948import to.bitkit.di.BgDispatcher
5049import to.bitkit.env.Env
5150import to.bitkit.ext.WatchResult
51+ import to.bitkit.ext.amountOnClose
5252import to.bitkit.ext.getClipboardText
5353import to.bitkit.ext.getSatsPerVByteFor
5454import 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