Author

Topic: Two wallets with pruned node cause one wallet going out of sync (Read 87 times)

HCP
legendary
Activity: 2086
Merit: 4361
As the blockchain is downloaded and scanned, the wallet file is updated to essentially indicate which block it is synced up to.

For instance, let's say that your node is fully synced, and pruned so it currently has block data from 695816 to 697816. Wallet #1 was open during download/sync, so it has been synced all the way from 0 to 697816.

Wallet#2 was not synced, so is effectively only synced to block 0... so, when you open wallet#2... the node is "missing" 695815 blocks... they cannot be scanned to see if any transactions in those blocks involve addresses in wallet#2.

So, the only way to check these blocks is to redownload them. This is why you get the error message that says:
Quote
"bitcoin closing the wallet for too long can result in having to resync the entire chain if pruning is enabled"
If you close a wallet and pruning is enabled... it's warning you that if the wallet sync point ends up outside of the range of blocks on disk... the node will end up having to redownload the entire chain again to sync that wallet.


The solution? Open both wallets at the same time when syncing the node, as Bitcoin Core supports having multiple wallet files "open". That way, both will be updated simultaneously.

Then, either leave them both open all the time... or make sure you are regularly opening/syncing both wallets to ensure they don't fall out of the block range stored on disk.
copper member
Activity: 906
Merit: 2258
Quote
it wasn't loaded for some reason
It wasn't loaded, because it was closed. So that means all wallets have to be opened during downloading the blockchain?
legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
1. Create two wallets using Bitcoin Core.
2. Sync the whole blockchain with pruning mode using the first wallet.
3. Open the second wallet.

That wallet will need redownloading the chain. Why?
The second wallet might be unloaded when your tried to sync the blockchain.
So it needs to be synced once you loaded it.

But a new wallet is automatically loaded after creation, thus should be scanned together with the first wallet.
But since you said "open" (file->open wallet; Qt?), and if it's available from the selection (for Qt) or didn't returned with "already loaded" (for cli),
then it wasn't loaded for some reason.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
That wallet will need redownloading the chain. Why?

Think it as a full node. When you were done with the first wallet and went to the second, you would wait to for the blockchain's rescanning to select the transactions that are related with your wallet. Since you don't have the blockchain, you ought to re-download it and rescan it simultaneously.
legendary
Activity: 3668
Merit: 6382
Looking for campaign manager? Contact icopress!
1. Create two wallets using Bitcoin Core.
2. Sync the whole blockchain with pruning mode using the first wallet.
3. Open the second wallet.

That wallet will need redownloading the chain. Why?

From my understanding, the pruned blockchain you have after step 2, while it contains the "branches", it only has the "leaves" relevant for your wallet.
At changing wallet it doesn't "know" where to get from (which blocks) the new relevant "leaves", hence it downloads everything again.
copper member
Activity: 906
Merit: 2258
1. Create two wallets using Bitcoin Core.
2. Sync the whole blockchain with pruning mode using the first wallet.
3. Open the second wallet.

That wallet will need redownloading the chain. Why?
Jump to: