Skip to content

Commit 1ef274a

Browse files
lklimekclaude
andcommitted
fix: case-insensitive .dash suffix and UTXO double-spend prevention
- SDK: resolve_dpns_name() now handles ".DASH", ".Dash" etc. via eq_ignore_ascii_case (backport of dash-evo-tool PR #810 fix) - platform-wallet: send_transaction() now calls check_core_transaction() after signing to mark spent UTXOs before broadcast, preventing concurrent callers from selecting the same inputs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 66c3ace commit 1ef274a

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

  • packages
    • rs-platform-wallet/src/wallet/core
    • rs-sdk/src/platform/dpns_usernames

packages/rs-platform-wallet/src/wallet/core/wallet.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,17 @@ impl CoreWallet {
316316
self.sign_transaction_inputs(&secp, &mut tx, &selected_utxos)
317317
.await?;
318318

319+
// 5b. Mark spent UTXOs immediately while we can still prevent
320+
// concurrent callers from selecting the same inputs.
321+
{
322+
use crate::wallet::platform_wallet_traits::WalletTransactionChecker;
323+
use key_wallet::transaction_checking::TransactionContext;
324+
let mut state = self.state.write().await;
325+
state
326+
.check_core_transaction(&tx, TransactionContext::Mempool, true, true)
327+
.await;
328+
}
329+
319330
// 6. Broadcast.
320331
self.broadcast_transaction(&tx).await?;
321332

packages/rs-sdk/src/platform/dpns_usernames/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ impl Sdk {
427427
let label = if let Some(dot_pos) = name.rfind('.') {
428428
let (label_part, suffix) = name.split_at(dot_pos);
429429
// Only strip the suffix if it's exactly ".dash"
430-
if suffix == ".dash" {
430+
if suffix.eq_ignore_ascii_case(".dash") {
431431
label_part
432432
} else {
433433
// If it's not ".dash", treat the whole thing as the label

0 commit comments

Comments
 (0)