Added wallet-identity check before allocation

This commit is contained in:
2026-10-21 15:25:00 -04:00
parent c8cf8245fc
commit 0534cde1a9
6 changed files with 61 additions and 13 deletions
@@ -238,6 +238,10 @@ export async function createOrRecoverMoneroDepositSubaddress(
return { allocation: toAllocation(current.rows[0]), replayed: true };
}
const allocation = current.rows[0];
const liveWalletFingerprint = await rpc.verifyWallet();
if (liveWalletFingerprint !== allocation.wallet_fingerprint) {
throw new Error('Configured Monero wallet identity differs from the durable allocation generation');
}
const expectedLabel = `wikideck-deposit-v1:${allocation.allocation_id}`;
const expectedIndex = Number(allocation.address_index);
const existing = await rpc.getSubaddress(Number(allocation.account_index), expectedIndex);