Skip to content

Commit 06d9f8c

Browse files
committed
sort xfp byte array instead of xfp string during recovery
1 parent 984d6fc commit 06d9f8c

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/components/Recover.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,8 @@ const Recover: React.FC<RecoverProps> = ({ state, setState }) => {
137137
throw new Error('Invalid master fingerprint');
138138
}
139139

140-
const xfpArray = (xfp0 < xfp1) ? [xfp0, xfp1] : [xfp1, xfp0];
141-
142140
const xfpPairFingerprint = await sha256(
143-
joinUint8Arrays(xfpArray.map(hexToUint8Array))
141+
joinUint8Arrays([xfp0, xfp1].map(hexToUint8Array).sort())
144142
).then(hash => uint8ArrayToHex(hash.slice(0, 4)));
145143

146144
const xfpResponse = await fetch(`${RECOVER_URL}/inscriptionIds/${xfpPairFingerprint}`);

0 commit comments

Comments
 (0)