Quick question, balance as of a date

Darren

Active member
So I have the wallet.dat file and I want to determine the balance around Dec 2020. I can't find an easy way to do this. Any ideas?
 
You can try using this RPC call (paste it into the debug console)


Code:
getbalance "*" 742804


What it does is determine the balance based on 742804 confirmations, which means any coins that have moved since then won't be included in the balance.

Also, another thing to try is to start a reindex of the wallet, in the wallet repair menu item, this will rescan the block chain, your wallet balance should show as zero. watch it closely and when the data (see the information screen) gets to December 2020, pull the network plug, or go to airplane mode, or turn off the router, etc to kill the internet and stop the syncing, the balance it shows then, will be correct as of that block. Actually, since that is just a reindex, it might not stop syncing, in which case, be prepared to snip the balance of the wallet, with the snipping tool, eg SHIFT+WIN+S or click on the window you want to screen grab and hit ALT+PRINTSCREEN to capture it.
 
Thank you @xkcd but I'm still having trouble.

The 'getbalance "*" n' command only works if there haven't been any spends in the last n blocks.

I did replay the blockchain but the wallet.dat remembers the future transactions and still gives the future balance.

I was able to dump private keys with the dump wallet command, but haven't found an easy way to import them to a new wallet. The replay solution you mention should work then.
 
I was able to dump private keys with the dump wallet command, but haven't found an easy way to import them to a new wallet. The replay solution you mention should work then.


I agree. So, what I do in this case is use the dump wallet command, to get a complete copy of all the keys, then create a new wallet and import that dump with the import wallet command and it will automatically start a rescan, which will find the balances. However, from memory, I don't think you see the progress through time, so instead, I would import the dump file into a unsynchronised dash client, OR give the rescan option the value false when importing and then starting the reindex myself. I think that should work.
 
Back
Top