How to shrink wallet.dat? It's over 200MB #4196

issue miningpoolhub opened this issue on May 19, 2014
  1. miningpoolhub commented at 3:56 PM on May 19, 2014: none

    Hi I'm running a pool.

    Is there any method to shrink wallet.dat? There's so many not using keys in wallet.dat. It's growing and growing, over 200MB.

    Well, it's not about bitcoin, actually it's altcoin. But this problem lies same in bitcoin too. What is the right method, easily clean not using keys.

    "change=" option may work, but not all altcoin's have this option. Also it must be ran before wallet.dat gets bigger.

    Any dirty method is appreciated too. I want to reduce the wallet.dat safely.

  2. Diapolo commented at 8:35 PM on May 19, 2014: none

    Isn't there an issue tracker for your altcoin :-P?

  3. leofidus commented at 8:42 PM on May 19, 2014: none

    If you don't receive any transactions with the wallet, you could just send the entire balance to a new wallet and use that new wallet file from now on. That's not really ideal from a privacy standpoint, but it's a solution. Alternatively export all relevant private keys and import them into a new wallet, leaving those you don't need behind.

  4. laanwj commented at 8:47 PM on May 19, 2014: member

    You could try -zapwallettx. It will remove all transactions from the wallet and rescan them from the block chain. This may make the wallet smaller. After that you could compact the bdb file like this to get rid of empty space:

    cp wallet.dat wallet.dat.backup
    db4.8_dump wallet.dat | db4.8_load wallet.dat.new
    mv wallet.dat.new wallet.dat
    
  5. laanwj closed this on May 19, 2014

  6. bitcoin locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:55 UTC