fix: sign and export with each address's own derivation index (closes #510)
Sending, site transactions, site signatures and private key export derived the key at the address's position in the wallet's list. After an import whose scan passed over an unused index, or after removing an address that was not the last, that position named another address's key. Each HD and xprv address record now stores the index it was derived at (at wallet creation, by the import scan, by "+"), and getSignerForAddress() derives at that index and refuses any key whose address differs from the record's. The export screen reports that refusal instead of calling the password wrong. Model: opus-5-5
This commit is contained in:
@@ -136,7 +136,9 @@ async function openTxApproval(approvedTx) {
|
||||
xpub: "xpub-wallet-1",
|
||||
encryptedSecret: "encrypted-secret-1",
|
||||
nextIndex: 1,
|
||||
addresses: [{ address: FROM, balance: "0", tokenBalances: [] }],
|
||||
addresses: [
|
||||
{ address: FROM, index: 0, balance: "0", tokenBalances: [] },
|
||||
],
|
||||
},
|
||||
];
|
||||
approval.init({});
|
||||
|
||||
Reference in New Issue
Block a user