Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 6 additions & 7 deletions app/src/main/java/to/bitkit/async/ServiceQueue.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import kotlin.coroutines.CoroutineContext
enum class ServiceQueue {
LDK, CORE, FOREX, MIGRATION;

private val scope by lazy { CoroutineScope(dispatcher("$name-queue".lowercase()) + SupervisorJob()) }
private val scope by lazy { CoroutineScope(newSingleThreadDispatcher(name) + SupervisorJob()) }

fun <T> blocking(
coroutineContext: CoroutineContext = scope.coroutineContext,
Expand Down Expand Up @@ -52,11 +52,10 @@ enum class ServiceQueue {
}
}
}
}

companion object {
fun dispatcher(name: String): ExecutorCoroutineDispatcher {
val threadFactory = ThreadFactory { Thread(it, name).apply { priority = Thread.NORM_PRIORITY - 1 } }
return Executors.newSingleThreadExecutor(threadFactory).asCoroutineDispatcher()
}
}
fun newSingleThreadDispatcher(id: String): ExecutorCoroutineDispatcher {
val name = "$id-queue".lowercase()
val threadFactory = ThreadFactory { Thread(it, name).apply { priority = Thread.NORM_PRIORITY - 1 } }
return Executors.newSingleThreadExecutor(threadFactory).asCoroutineDispatcher()
}
3 changes: 2 additions & 1 deletion app/src/main/java/to/bitkit/env/Env.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ internal object Env {

val ldkRgsServerUrl
get() = when (network) {
Network.BITCOIN -> "https://rgs.blocktank.to/snapshot/"
Network.BITCOIN -> "https://rgs.blocktank.to/snapshot"
Network.TESTNET -> "https://rapidsync.lightningdevkit.org/testnet/snapshot"
Network.REGTEST -> "https://bitkit.stag0.blocktank.to/rgs/snapshot"
else -> null
}

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/to/bitkit/services/LightningService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ class LightningService @Inject constructor(
private suspend fun Builder.configureGossipSource(customRgsServerUrl: String?) {
val rgsServerUrl = customRgsServerUrl ?: settingsStore.data.first().rgsServerUrl
if (rgsServerUrl != null) {
Logger.info("Using gossip source rgs url: $rgsServerUrl")
Logger.info("Using gossip source: RGS server '$rgsServerUrl'")
setGossipSourceRgs(rgsServerUrl)
} else {
Logger.info("Using gossip source p2p")
Logger.info("Using gossip source: P2P")
setGossipSourceP2p()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ package to.bitkit.ui.screens.wallets.receive
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ fun ChannelStatusView(
}
}

@Suppress("CyclomaticComplexMethod")
@Suppress("CyclomaticComplexMethod", "ReturnCount")
@Composable
private fun getStatusInfo(
channel: ChannelUi,
Expand Down
Loading