Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: CryptoBuzzerd on December 08, 2019, 11:06:54 AM



Title: Bitcoincore in PRUNE mode with new wallet.dat file
Post by: CryptoBuzzerd on December 08, 2019, 11:06:54 AM
Bitcoincore PRUNE mode needs rebuild whole blockchain from scratch when changing wallet.dat file - is it normal? Is it possible to change it him behavior? I have some back-up copies different bitcoincore wallet.dat files - but in PRUNE mode (PRUNE=500) it restart syncing every time I've replace wallet.dat file to another copy. Sure, every time I have close bitcoincore wallet, and some times even reboot PC before replacing. Also trying PRUNE=1000, and 3000, also 50 000 - result the same. So what option need enable (or disable) for correct replacing different wallet.dat files in prune mode without full syncing?


Title: Re: Bitcoincore in PRUNE mode with new wallet.dat file
Post by: ranochigo on December 08, 2019, 11:10:09 AM
Enabling the pruning option means that the client deletes the unnecessary parts of the blockchain as it synchronises. The client will retain the information that is relevant to the addresses in the wallet.dat while discarding the rest.

Your wallet cannot have the full transaction history without the client synchronising from scratch.


Title: Re: Bitcoincore in PRUNE mode with new wallet.dat file
Post by: nc50lc on December 08, 2019, 12:00:45 PM
Also trying PRUNE=1000, and 3000, also 50 000 - result the same. So what option need enable (or disable) for correct replacing different wallet.dat files in prune mode without full syncing?
Even if you managed to set it to 90% of the total blockchain size, it will have to rebuild from scratch because the chain needs to start from the genesis block and the few first blocks which are the first ones that will get deleted if your node was pruned.

Just disable pruning,
if you have the resources to sync a prune node, you might have the funds to buy a cheap 1TB/350GB/500GB HDD.


Title: Re: Bitcoincore in PRUNE mode with new wallet.dat file
Post by: CryptoBuzzerd on December 08, 2019, 03:01:01 PM
It's a known issue (https://github.com/bitcoin/bitcoin/issues/9409 (https://github.com/bitcoin/bitcoin/issues/9409)), but there's no plan to support changing wallet.dat without sync whole blockchain again.

4. Run Electrum server and configure your Electrum only connect to your Electrum server

"4. Run Electrum server and configure your Electrum only connect to your Electrum server" - how it can help me to use many different wallet.dat files?


Title: Re: Bitcoincore in PRUNE mode with new wallet.dat file
Post by: LoyceV on December 08, 2019, 03:40:24 PM
Even if you managed to set it to 90% of the total blockchain size, it will have to rebuild from scratch because the chain needs to start from the genesis block and the few first blocks which are the first ones that will get deleted if your node was pruned.
You indeed can't retroactively increase the pruned size to restore an older wallet. But for future use, this can help:
I've used Bitcoin Core with "Prune block storage 99 GB" for a while, and that was enough to restore wallets from a long time ago. As long as the wallet.dat is used before your oldest block gets pruned, you have all the blocks needed to completely update that wallet.

If CryptoBuzzerd updates all his wallet.dat files now, he can prune Bitcoin Core again as long as he loads each wallet once in a while.


Title: Re: Bitcoincore in PRUNE mode with new wallet.dat file
Post by: NeuroticFish on December 08, 2019, 03:48:05 PM
4. Run Electrum server and configure your Electrum only connect to your Electrum server

I don't know how would this help, sorry. ElectrumX needs Bitcoind and the whole blockchain.

You must to be running a non-pruning bitcoin daemon


OP, if you change frequently the wallet file, I think that you need either a non-pruning Bitcoin wallet, either an Electrum (client) with default settings (if that's OK for you on privacy).
Or maybe you rethink what you do there and find a way to not change the wallet files. OR, for example if you have a (very) small number of them, you keep switching maybe you trick it with symlinks to point to the correct data folder depending on the wallet you use (of course, you'll still download the whole blockchain once for each wallet).

But I think that Electrum could be just fine.


Title: Re: Bitcoincore in PRUNE mode with new wallet.dat file
Post by: CryptoBuzzerd on December 08, 2019, 09:31:53 PM
Thanks to all for your messages, I appreciated with it. So I got info I need - it is restriction of Bitcoincore itself, so I'm giving up in this situation. But this info is VERY useful, and I still can be done some things using it.