Skip to content
Open
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
293 changes: 0 additions & 293 deletions features/exploredash/src/main/res/layout/fragment_explore.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import androidx.work.workDataOf
import dagger.hilt.android.qualifiers.ApplicationContext
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import org.bitcoinj.core.Address
import org.bitcoinj.core.Coin
import org.bitcoinj.core.Transaction
Expand Down Expand Up @@ -121,6 +123,11 @@ class CrowdNodeApiAggregator @Inject constructor(
)
private var isOnlineStatusRestored: Boolean = false

// Serializes restoreStatus() so concurrent callers (e.g. the init call and the
// blockchain-sync observer) don't both scan the whole wallet and contend on the
// wallet keychain lock at the same time.
private val restoreStatusMutex = Mutex()

override val signUpStatus = MutableStateFlow(SignUpStatus.NotStarted)
override val onlineAccountStatus = MutableStateFlow(OnlineAccountStatus.None)
override val balance = MutableStateFlow(Resource.success(Coin.ZERO))
Expand Down Expand Up @@ -162,20 +169,20 @@ class CrowdNodeApiAggregator @Inject constructor(
.launchIn(configScope)
}

override suspend fun restoreStatus() {
override suspend fun restoreStatus() = restoreStatusMutex.withLock {
if (signUpStatus.value == SignUpStatus.NotStarted) {
log.info("restoring CrowdNode status")

if (isError()) {
return
return@withLock
}

if (tryRestoreSignUp()) {
requireNotNull(accountAddress) { "Restored signup tx set but address is null" }
globalConfig.crowdNodeAccountAddress = accountAddress!!.toBase58()
restoreCreatedOnlineAccount(accountAddress!!)
refreshWithdrawalLimits()
return
return@withLock
}

val onlineStatusOrdinal = config.get(CrowdNodeConfig.ONLINE_ACCOUNT_STATUS)
Expand Down
3 changes: 1 addition & 2 deletions wallet/res/navigation/nav_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@
<fragment
android:id="@+id/exploreFragment"
android:name="de.schildbach.wallet.ui.explore.ExploreFragment"
android:label="Explore"
tools:layout="@layout/fragment_explore">
android:label="Explore">

<argument
android:name="ShowNavBar"
Expand Down
5 changes: 5 additions & 0 deletions wallet/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -447,4 +447,9 @@
<string name="upgrade_pin_title">You need to upgrade your PIN</string>
<string name="upgrade_pin_description">Set up a new PIN</string>
<string name="upgrade_pin_continue">Continue</string>

<!-- CrowdNode withdrawal reminder -->
<string name="crowdnode_withdrawal_reminder_title">You have a balance on CrowdNode</string>
<string name="crowdnode_withdrawal_reminder_message">These funds should be withdrawn from CrowdNode. You can transfer these funds to this wallet or via your online account on some other device.</string>
<string name="crowdnode_withdraw_funds">Withdraw funds</string>
</resources>
2 changes: 1 addition & 1 deletion wallet/src/de/schildbach/wallet/WalletApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public void onCreate() {

}

// Initialize AppsFlyer after checking Google Play Services availability
// Initialize AppsFlyer
private void initializeAppsFlyer() {
try {
AppsFlyerLib appsFlyerLib = AppsFlyerLib.getInstance();
Expand Down
Loading
Loading