Skip to content
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
104d0e2
fix: if replaying, prevent giftcard purchase
HashEngineering Sep 2, 2025
0481815
fix: if replaying, prevent giftcard purchase
HashEngineering Sep 2, 2025
7849c7d
fix: log purchase errors with crashlytics, other DashSpend fixes
HashEngineering Sep 3, 2025
eac339e
fix: prevent crash from bad password
HashEngineering Sep 3, 2025
a8ed983
fix: remove obsolete file
HashEngineering Sep 8, 2025
06f39c1
fix: eliminate crash in PeerListFragment
HashEngineering Sep 8, 2025
fc5a692
fix: eliminate crash RequestUserNameViewModel.verify
HashEngineering Sep 8, 2025
3ae7b0b
fix: remove some debug logs
HashEngineering Sep 8, 2025
46386fa
fix: eliminate potential deadlocks in create, destroy BlockchainServi…
HashEngineering Sep 8, 2025
9ffbcf5
fix: fix crash when service is not bound on BlockListFragment
HashEngineering Sep 12, 2025
af92470
fix: use fitsSystemWindows on the Coinbase Result dialog
HashEngineering Sep 12, 2025
87e24c9
style: ktlint
HashEngineering Sep 16, 2025
2d17c99
fix: fit system windows on Username Registration Fragment
HashEngineering Sep 16, 2025
d91aa18
style: ktlint
HashEngineering Sep 16, 2025
f634237
fix: repair BIP21 support in EnterAmountFragment
HashEngineering Sep 17, 2025
39ef551
style: ktlint
HashEngineering Sep 17, 2025
a91e41b
fix: potential issues with replaying and fixed cards
HashEngineering Sep 17, 2025
e192b3e
fix: setReturns restore to show Platform Credits on topup details
HashEngineering Sep 18, 2025
42b8961
fix: improve topup functionality
HashEngineering Sep 19, 2025
6a41a06
chore: update dpp to 2.0.1-SNAPSHOT
HashEngineering Sep 19, 2025
9f8f0be
fix: eliminate crash if service is not bound
HashEngineering Sep 20, 2025
65ee90d
Merge branch 'master' of https://github.com/dashevo/dash-wallet into …
HashEngineering Sep 23, 2025
ec6c1cd
fix: coderabbitai fixes
HashEngineering Sep 23, 2025
6d6f3aa
fix: explore bugs
HashEngineering Sep 23, 2025
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 @@ -4,7 +4,7 @@ buildscript {
coroutinesVersion = '1.6.4'
ok_http_version = '4.9.1'
dashjVersion = '21.1.12-SNAPSHOT'
dppVersion = "2.0.0"
dppVersion = "2.0.1-SNAPSHOT"
hiltVersion = '2.53'
hiltCompilerVersion = '1.2.0'
hiltWorkVersion = '1.2.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1397,9 +1397,13 @@ class PlatformSynchronizationService @Inject constructor(
}
}

private var hasCheckedTopups = false // only run once
private suspend fun checkTopUps() {
platformRepo.getWalletEncryptionKey()?.let {
topUpRepository.checkTopUps(it)
if (!hasCheckedTopups) {
platformRepo.getWalletEncryptionKey()?.let {
topUpRepository.checkTopUps(it)
hasCheckedTopups = true
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ import kotlin.coroutines.resumeWithException
import kotlin.coroutines.suspendCoroutine
import de.schildbach.wallet.ui.dashpay.CreateIdentityService
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.withTimeout
import kotlinx.coroutines.TimeoutCancellationException
import org.bitcoinj.wallet.authentication.AuthenticationGroupExtension
import java.util.concurrent.TimeUnit
Comment thread
HashEngineering marked this conversation as resolved.

/**
* contains topup related functions that are used by [CreateIdentityService] to create
Expand Down Expand Up @@ -254,13 +257,59 @@ class TopUpRepositoryImpl @Inject constructor(
) ?: addTopUp(topUpTx.txId)
Context.propagate(walletDataProvider.wallet!!.context)
val confidence = topUpTx.getConfidence(walletDataProvider.wallet!!.context)
log.info("topup tx confidence: {}", confidence)
val wasTxSent = confidence.isChainLocked ||
confidence.isTransactionLocked ||
confidence.confidenceType == TransactionConfidence.ConfidenceType.BUILDING ||
confidence.numBroadcastPeers() > 0

if (!wasTxSent) {
sendTransaction(topUpTx)
} else {
// wait for IX Lock or mining if the TX has been sent
// the transaction was probably sent previously
if (confidence.numBroadcastPeers() > 0 && confidence.confidenceType == TransactionConfidence.ConfidenceType.PENDING) {
try {
withTimeout(TimeUnit.SECONDS.toMillis(30)) {
suspendCoroutine { continuation ->
val listener = object : TransactionConfidence.Listener {
override fun onConfidenceChanged(confidence: TransactionConfidence?, reason: TransactionConfidence.Listener.ChangeReason?) {
when (reason) {
TransactionConfidence.Listener.ChangeReason.IX_TYPE -> {
if (confidence!!.isTransactionLocked || confidence.ixType == TransactionConfidence.IXType.IX_REQUEST) {
log.info("topup: observe ISLock")
confidence.removeEventListener(this)
continuation.resumeWith(Result.success(Unit))
}
}
TransactionConfidence.Listener.ChangeReason.DEPTH,
TransactionConfidence.Listener.ChangeReason.CHAIN_LOCKED -> {
if (confidence!!.confidenceType == TransactionConfidence.ConfidenceType.BUILDING || confidence.isChainLocked) {
log.info("topup: observe block or chainlock")
confidence.removeEventListener(this)
continuation.resumeWith(Result.success(Unit))
}
}
else -> { /* ignore */ }
}
}
}
confidence.addEventListener(listener)
}
}
} catch (e: TimeoutCancellationException) {
// Timeout reached, continue with execution
log.info("topup, timeout waiting for islock, continue...")
}
}

Comment thread
HashEngineering marked this conversation as resolved.
}
log.info("topup tx sent: {}", topUpTx.txId)
val status = when (confidence.confidenceType) {
TransactionConfidence.ConfidenceType.BUILDING -> "mined in block ${confidence.appearedAtChainHeight}"
TransactionConfidence.ConfidenceType.PENDING -> "broadcast tx to ${confidence.numBroadcastPeers()} peers"
else -> confidence.toString()
}
log.info("topup tx sent: {}; tx = {}", status, topUpTx.txId)
try {
platformRepo.blockchainIdentity.topUp(
topUpTx,
Expand All @@ -275,6 +324,7 @@ class TopUpRepositoryImpl @Inject constructor(
if (e.message?.let { regex.matches(it) || it.contains("Object already exists: state transition already in chain")} == true) {
// the asset lock was already used
topUpsDao.insert(topUp.copy(creditedAt = System.currentTimeMillis()))
log.info("topup success, already submitted: {}", topUpTx.txId)
} else {
throw e
}
Expand Down Expand Up @@ -305,10 +355,14 @@ class TopUpRepositoryImpl @Inject constructor(
if (topUp == null) {
topUpsDao.insert(TopUp(assetLockTx.txId, identity))
}
topUpIdentity(assetLockTx, platformRepo.getWalletEncryptionKey()!!)
try {
topUpIdentity(assetLockTx, platformRepo.getWalletEncryptionKey()!!)
// TopupIdentityOperation(walletApplication)
// .create(identity, assetLockTx.txId)
// .enqueue()
} catch (e: Exception) {
// swallow
}
}
}
checkedPreviousTopUps = true
Expand Down
6 changes: 5 additions & 1 deletion wallet/src/de/schildbach/wallet/ui/BlockListFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,11 @@ public void onPause() {
@Override
public void onDestroy() {
if (serviceIsBound) {
activity.unbindService(serviceConnection);
try {
activity.unbindService(serviceConnection);
} catch (IllegalArgumentException e) {
log.warn("Service not registered when unbinding", e);
}
serviceIsBound = false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class TransactionResultViewBinder(
} else {
setInputs(inputAddresses, inflater)
setOutputs(outputAddresses, inflater)
//setReturns(outputAssetLocks, inflater, false)
setReturns(outputAssetLocks, inflater, false, true)
}

// For displaying purposes only
Expand Down
Loading