Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: MakFrogz on May 20, 2019, 09:25:08 AM



Title: How to save blocks?
Post by: MakFrogz on May 20, 2019, 09:25:08 AM
Hi, guys!

I have one problem, when i reboot node it start download block from 0. How i can save blocks and after reboot take last saved block and start download from this block?


Title: Re: How to save blocks?
Post by: ranochigo on May 20, 2019, 09:27:59 AM
What client and OS are you using? If you're using the reference client to synchronize with the network, it should be able to continue the download from the last validated block automatically. That is unless if the data files were corrupted after you shut it down. If so, did you receive any warning about the blocks being corrupted and that you need to reindex the chain?


Title: Re: How to save blocks?
Post by: bob123 on May 20, 2019, 09:28:48 AM
About which wallet are you talking ?

Core does not redownload all blocks each time you start it up (would take several days on each startup?)

However, when you start up core, it downloads the new blocks (newly mined after you shut down your blocks the last time).

Can you manually verify that the blocks are saved in the datadir and that the config of core does indeed point towards this directory ?


Title: Re: How to save blocks?
Post by: NeuroticFish on May 20, 2019, 09:56:46 AM
Most wallets need to be properly closed, especially if they didn't finish sync-ing. Maybe you should start with small steps: leave your wallet running for 10-20 minutes, write down the current block number (approx), stop your wallet (and make sure it's stopped, not just hidden to tray! if it's the case right click and stop it nicely for good), then reboot.
At the next start you can check if it's before or after the block number you wrote it down.

If it's still "from start", then we'll need more details...


Title: Re: How to save blocks?
Post by: Heisenberg_Hunter on May 20, 2019, 10:05:53 AM
Assuming OP has bitcoin core running in his PC,

There are possibilities of such re-downloading when OP didn't shut down his core wallet properly. When there is a force shutting down of the wallet or the PC, the downloaded blocks should be present in the blk*.dat and they weren't written to the HDD completely. Not sure still, but there seems to be a possibility of such cases when the download starts from the genesis block.

@MakFrogz During sync time, you could increase the dbcache in the bitcoin.conf file. This could increase the chances of syncing up the download and saving the blocks in the HDD. I don't use a full node much, but based on my understanding I have answered.


Title: Re: How to save blocks?
Post by: MakFrogz on May 21, 2019, 12:55:36 PM
Thx guys. Problem was in config, I missed param "datadir" :D :D :D