Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(coinjoin): fix ANR when coinjoin system starts #1313

Merged
merged 3 commits into from
Oct 8, 2024
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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
kotlin_version = '1.9.23'
coroutinesVersion = '1.6.4'
ok_http_version = '4.9.1'
dashjVersion = '21.1.0'
dashjVersion = '21.1.1-SNAPSHOT'
hiltVersion = '2.51'
hiltCompilerVersion = '1.2.0'
hiltWorkVersion = '1.0.0'
Expand Down
4 changes: 3 additions & 1 deletion wallet/src/de/schildbach/wallet/ui/main/WalletActivityExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ import de.schildbach.wallet.WalletBalanceWidgetProvider
import de.schildbach.wallet.service.CoinJoinMode
import de.schildbach.wallet.ui.more.MoreFragment
import de.schildbach.wallet_test.R
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import org.dash.wallet.common.services.analytics.AnalyticsConstants
import org.dash.wallet.common.ui.components.ComposeHostFrameLayout
import org.dash.wallet.common.ui.components.Toast
Expand Down Expand Up @@ -143,7 +145,7 @@ object WalletActivityExt {

fun MainActivity.checkTimeSkew(viewModel: MainViewModel, force: Boolean = false) {
lifecycleScope.launch {
val (isTimeSkewed, timeSkew) = viewModel.getDeviceTimeSkew(force)
val (isTimeSkewed, timeSkew) = withContext(Dispatchers.IO) { viewModel.getDeviceTimeSkew(force) }
val coinJoinOn = viewModel.getCoinJoinMode() != CoinJoinMode.NONE
if (isTimeSkewed && (!timeSkewDialogShown || force)) {
timeSkewDialogShown = true
Expand Down
Loading