-
Notifications
You must be signed in to change notification settings - Fork 586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow setting the start block for address rescans #883
Comments
Did you try this on mainnet? Because there is an explicit mechanism added for that where the wallet birthday is turned into a block height. If I remember correctly, there's always a "safety period" of 24 (or was it 48) hours subtracted from the birthday to avoid this exact issue... That might not work on a local network (like regtest/simnet), as the block dates/times might be off. |
Yeah I tried on mainnet. I see though that the birthday is given a 48 hour safety period. Still, if I (1) create a wallet, (2) fund one of the addresses, (3) delete the wallet.db file, (4) wait >48hrs, (5) recreate the wallet with the seed and re-add the address, the transaction from step 2 will not be indexed. This is because the birthday will be registered as 2 days before the address was added, which will still be further in time than when the transaction happened. |
When you say "seed", what format of seed are we talking about? Because in |
I'm talking about the bitcoin wallet seed that is returned when creating a wallet with I haven't seen any option that would allow a user to manually specify a wallet's birthday, but I'd like to implement that as a new feature. |
Description
In the event that the wallet.db file is deleted, the same wallet can be restored using the seed. Addresses that need their transactions indexed can be added to the wallet with calls to
getnewaddress
. Upon restarting, btcwallet will perform a rescan on those addresses.The issue here is that the rescan begins from the "birthdate" of when the addresses were added to the wallet. So if they are newly added, their older transaction history is missed during the rescan.
To Reproduce
btcwallet --create
getnewaddress
call to add an address to the walletgetbalance
andlisttransactions
callsbtcwallet will think the balance is zero and that the addresses have no transactions because the rescan started at a block above the block that the funding transaction was in.
Tasks
Add a flag to specify the blockhash/blockheight where the rescan should start. This flag should make the address creation date irrelevant to where to start the rescan, which would allow newly created addresses with past transactions to be properly accounted for.
The text was updated successfully, but these errors were encountered: