Closed stepansnigirev closed 4 years ago
Is that meant when scrolling over wallet addresses (with Next/Previous button), we should warn at the address that exceeds the gap limit?
We could determine the address index from the scanned PSBT's inputs and store it into _wallet.json if bigger?
To determine the address index we need to loop wallet.address(idx, change) with incrementing idx for both change values and match with PSBT inputs?
My thinking is:
0
(both receive and change) and stored in wallet.json
fileindex + gap_limit
- we show a warning.I think the address screen should start by default with a stored index, not zero. And it makes sense to add a warning if the displayed address is higher than index+gap_limit
. Both in browse address screen and when we verify the address.
The warning can be just another label, with red text, or a "prompt", I don't know what's better.
What do you think, does it make sense?
To determine the address index we need to loop wallet.address(idx, change) with incrementing idx for both change values and match with PSBT inputs?
PSBT inputs and outputs contain information about derivation indexes, so we don't need to loop through the indexes, we can get them from PSBT directly
Ok makes sense. I will grab this issue then.
Software wallets often have a gap limit of 20 addresses, so if my last change address was
m/.../1/123
and in the next transaction I use a changem/.../1/9999
it can cause lock of funds. We should warn the user if the change index is weird. To do this we should store the largest change index and warn if the next one is more than 20 larger.