@@ -4,6 +4,7 @@ import kotlinx.coroutines.CoroutineDispatcher
44import kotlinx.coroutines.withContext
55import to.bitkit.di.IoDispatcher
66import to.bitkit.ext.amountOnClose
7+ import to.bitkit.ext.runSuspendCatching
78import to.bitkit.models.NewTransactionSheetDetails
89import to.bitkit.models.NewTransactionSheetDirection
910import to.bitkit.models.NewTransactionSheetType
@@ -30,17 +31,17 @@ class NotifyChannelReadyHandler @Inject constructor(
3031 suspend operator fun invoke (
3132 command : NotifyChannelReady .Command ,
3233 ): Result <NotifyChannelReady .Result > = withContext(ioDispatcher) {
33- runCatching {
34+ runSuspendCatching {
3435 val channel = lightningRepo.getChannels()
3536 ?.find { it.channelId == command.event.channelId }
36- ? : return @runCatching NotifyChannelReady .Result .Skip
37+ ? : return @runSuspendCatching NotifyChannelReady .Result .Skip
3738
3839 val cjitEntry = blocktankRepo.getCjitEntry(channel)
39- ? : return @runCatching NotifyChannelReady .Result .Skip
40+ ? : return @runSuspendCatching NotifyChannelReady .Result .Skip
4041
4142 val inserted = activityRepo.insertActivityFromCjit(cjitEntry = cjitEntry, channel = channel)
4243 .getOrDefault(false )
43- if (! inserted) return @runCatching NotifyChannelReady .Result .Duplicate
44+ if (! inserted) return @runSuspendCatching NotifyChannelReady .Result .Duplicate
4445
4546 val sats = channel.amountOnClose.toLong()
4647
0 commit comments