Skip to content
Merged

Fix10 #215

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
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opwallet",
"version": "1.9.0",
"version": "1.9.1",
"private": true,
"type": "module",
"homepage": "https://github.com/btc-vision/opwallet#readme",
Expand Down Expand Up @@ -102,7 +102,7 @@
"loglevel": "^1.9.2",
"lru-cache": "^11.5.2",
"nanoid": "^6.0.0",
"opnet": "^1.9.1",
"opnet": "^1.10.0",
"pako": "^3.0.1",
"postcss": "^8.5.22",
"postcss-preset-env": "^11.3.2",
Expand Down
14 changes: 13 additions & 1 deletion src/background/controller/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4964,7 +4964,19 @@ export class WalletController {
return false;
}

return !!(info as { mldsaHashedPublicKey?: string }).mldsaHashedPublicKey;
const mldsa = info as { mldsaLinked?: boolean; mldsaHashedPublicKey?: string };

// `mldsaLinked` is authoritative. `mldsaHashedPublicKey` is NOT a linkage
// signal: when the node is queried with a 32-byte key it echoes that key
// back as the identity whether or not a link exists, so keying off its
// presence reports a false positive on a first link, skips the reveal and
// gets the transaction rejected. Nodes older than that field omit it, so
// fall back to the previous behaviour rather than always revealing.
Comment on lines +4969 to +4974
if (typeof mldsa.mldsaLinked === 'boolean') {
return mldsa.mldsaLinked;
}

return !!mldsa.mldsaHashedPublicKey;
} catch {
return false;
}
Expand Down
18 changes: 14 additions & 4 deletions src/ui/pages/Wallet/TxOpnetConfirmScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2046,10 +2046,20 @@ export default function TxOpnetConfirmScreen() {
currentWalletAddress.pubkey
);
const info = pubKeyInfo[currentWalletAddress.pubkey];
alreadyLinkedMLDSA =
!!info &&
!('error' in info) &&
!!(info as { mldsaHashedPublicKey?: string }).mldsaHashedPublicKey;

if (info && !('error' in info)) {
const mldsa = info as { mldsaLinked?: boolean; mldsaHashedPublicKey?: string };

// `mldsaLinked` is authoritative. `mldsaHashedPublicKey` is NOT a
// linkage signal — for a 32-byte query the node echoes the key back
// whether or not a link exists, so testing it reports a false
// positive on a first link and the reveal gets skipped. Older nodes
// omit the field, so fall back to the previous behaviour.
alreadyLinkedMLDSA =
typeof mldsa.mldsaLinked === 'boolean'
? mldsa.mldsaLinked
: !!mldsa.mldsaHashedPublicKey;
}
} catch {
// Unknown: fall through to revealing. Wasted bytes beat a rejected tx.
alreadyLinkedMLDSA = false;
Expand Down