Skip to content

Commit 81a7318

Browse files
committed
chore: cleanup + lint
1 parent bb1c010 commit 81a7318

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

app/src/main/java/to/bitkit/async/ServiceQueue.kt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import kotlin.coroutines.CoroutineContext
1717
enum class ServiceQueue {
1818
LDK, CORE, FOREX, MIGRATION;
1919

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

2222
fun <T> blocking(
2323
coroutineContext: CoroutineContext = scope.coroutineContext,
@@ -52,11 +52,10 @@ enum class ServiceQueue {
5252
}
5353
}
5454
}
55+
}
5556

56-
companion object {
57-
fun dispatcher(name: String): ExecutorCoroutineDispatcher {
58-
val threadFactory = ThreadFactory { Thread(it, name).apply { priority = Thread.NORM_PRIORITY - 1 } }
59-
return Executors.newSingleThreadExecutor(threadFactory).asCoroutineDispatcher()
60-
}
61-
}
57+
fun newSingleThreadDispatcher(id: String): ExecutorCoroutineDispatcher {
58+
val name = "$id-queue".lowercase()
59+
val threadFactory = ThreadFactory { Thread(it, name).apply { priority = Thread.NORM_PRIORITY - 1 } }
60+
return Executors.newSingleThreadExecutor(threadFactory).asCoroutineDispatcher()
6261
}

app/src/main/java/to/bitkit/env/Env.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ internal object Env {
3232

3333
val ldkRgsServerUrl
3434
get() = when (network) {
35-
Network.BITCOIN -> "https://rgs.blocktank.to/snapshot/"
35+
Network.BITCOIN -> "https://rgs.blocktank.to/snapshot"
3636
Network.TESTNET -> "https://rapidsync.lightningdevkit.org/testnet/snapshot"
37-
Network.REGTEST -> "https://bitkit.stag0.blocktank.to//rgs/snapshot/"
37+
Network.REGTEST -> "https://bitkit.stag0.blocktank.to/rgs/snapshot"
3838
else -> null
3939
}
4040

app/src/main/java/to/bitkit/ui/screens/wallets/receive/ReceiveConfirmScreen.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ package to.bitkit.ui.screens.wallets.receive
33
import androidx.compose.foundation.layout.Arrangement
44
import androidx.compose.foundation.layout.Column
55
import androidx.compose.foundation.layout.Row
6-
import androidx.compose.foundation.layout.Spacer
76
import androidx.compose.foundation.layout.fillMaxSize
87
import androidx.compose.foundation.layout.fillMaxWidth
9-
import androidx.compose.foundation.layout.height
108
import androidx.compose.foundation.layout.navigationBarsPadding
119
import androidx.compose.foundation.layout.padding
1210
import androidx.compose.runtime.Composable

app/src/main/java/to/bitkit/ui/settings/lightning/components/ChannelStatusView.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ fun ChannelStatusView(
5959
}
6060
}
6161

62-
@Suppress("CyclomaticComplexMethod")
62+
@Suppress("CyclomaticComplexMethod", "ReturnCount")
6363
@Composable
6464
private fun getStatusInfo(
6565
channel: ChannelUi,

0 commit comments

Comments
 (0)