Added wallet-identity check before allocation
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user