Skip to content

Commit 82282b5

Browse files
authored
Merge pull request #449 from synonymdev/feat/rgs-regtest
feat: use staging RGS server on regtest
2 parents 0a120da + 81a7318 commit 82282b5

File tree

5 files changed

+11
-13
lines changed

5 files changed

+11
-13
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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +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"
3738
else -> null
3839
}
3940

app/src/main/java/to/bitkit/services/LightningService.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ class LightningService @Inject constructor(
143143
private suspend fun Builder.configureGossipSource(customRgsServerUrl: String?) {
144144
val rgsServerUrl = customRgsServerUrl ?: settingsStore.data.first().rgsServerUrl
145145
if (rgsServerUrl != null) {
146-
Logger.info("Using gossip source rgs url: $rgsServerUrl")
146+
Logger.info("Using gossip source: RGS server '$rgsServerUrl'")
147147
setGossipSourceRgs(rgsServerUrl)
148148
} else {
149-
Logger.info("Using gossip source p2p")
149+
Logger.info("Using gossip source: P2P")
150150
setGossipSourceP2p()
151151
}
152152
}

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)