File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
app/src/main/java/to/bitkit Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import kotlinx.coroutines.flow.update
2626import kotlinx.coroutines.isActive
2727import kotlinx.coroutines.launch
2828import kotlinx.coroutines.withContext
29+ import org.lightningdevkit.ldknode.ChannelDetails
2930import to.bitkit.data.CacheStore
3031import to.bitkit.di.BgDispatcher
3132import to.bitkit.env.Env
@@ -96,12 +97,11 @@ class BlocktankRepo @Inject constructor(
9697 }
9798 }
9899
99- suspend fun isCjitOrder (channelId : String ): Boolean = withContext(bgDispatcher) {
100+ suspend fun isCjitOrder (channel : ChannelDetails ): Boolean = withContext(bgDispatcher) {
100101 return @withContext runCatching {
101- val channel = lightningService.channels?.find { it.channelId == channelId }
102102 _blocktankState .value.cjitEntries.any { order ->
103- order.channelSizeSat == channel? .channelValueSats &&
104- order.lspNode.pubkey == channel.counterpartyNodeId
103+ order.channelSizeSat == channel.channelValueSats &&
104+ order.lspNode.pubkey == channel.counterpartyNodeId
105105 }
106106 }.getOrDefault(false )
107107 }
Original file line number Diff line number Diff line change @@ -213,7 +213,7 @@ class AppViewModel @Inject constructor(
213213
214214 is Event .ChannelReady -> {
215215 val channel = lightningRepo.getChannels()?.find { it.channelId == event.channelId }
216- if (channel != null && blocktankRepo.isCjitOrder(event.channelId )) {
216+ if (channel != null && blocktankRepo.isCjitOrder(channel )) {
217217 showNewTransactionSheet(
218218 NewTransactionSheetDetails (
219219 type = NewTransactionSheetType .LIGHTNING ,
You can’t perform that action at this time.
0 commit comments