Delay initial pruning until after wallet init #6356

pull ajweiss wants to merge 1 commits into bitcoin:master from ajweiss:ajw_1506_prune_after_walletscan changing 1 files +16 −11
  1. ajweiss commented at 7:35 PM on June 30, 2015: contributor

    Don't prune until any wallet rescanning has taken place to avoid potentially pruning blocks that the wallet rescan may need.

    Fixes #6345

  2. jonasschnelli commented at 7:40 PM on June 30, 2015: contributor

    Nice. utACK. Have plans to test this soon.

  3. laanwj added the label Wallet on Jul 2, 2015
  4. jonasschnelli commented at 8:19 PM on July 14, 2015: contributor

    Tested ACK (was hard to reproduce).

    Prove (mind the rescanning before the pruning):

    Opening LevelDB in /home/gitian/.bitcoinPruned/blocks/index
    Opened LevelDB successfully
    Opening LevelDB in /home/gitian/.bitcoinPruned/chainstate
    Opened LevelDB successfully
    LoadBlockIndexDB: last block file = 300
    LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=159, size=113623915, heights=365157...365313, time=2015-07-13...2015-07-14)
    Checking all blk files are present...
    LoadBlockIndexDB: transaction index disabled
    LoadBlockIndexDB: hashBestChain=00000000000000000249e73efe3b8b525bb8aca95b9abc8f8cb2287d6eaec02b height=365313 date=2015-07-14 19:24:07 progress=0.999956
    init message: Verifying blocks...
    Verifying last 288 blocks at level 3
    No coin database inconsistencies in last 4 blocks (5533 transactions)
     block index           43301ms
    init message: Loading wallet...
    nFileVersion = 119900
    Keys: 102 plaintext, 0 encrypted, 102 w/ metadata, 102 total
     wallet                   90ms
    init message: Rescanning...
    Rescanning last 325539 blocks (from block 39774)...
    Still rescanning. At block 352297. Progress=0.871212
    Still rescanning. At block 357888. Progress=0.929899
    Still rescanning. At block 364980. Progress=0.996939
     rescan               185582ms
    Unsetting NODE_NETWORK on prune mode
    Prune: target=550MiB actual=405MiB diff=144MiB max_prune_height=365025 removed 298 blk/rev pairs
    Prune: UnlinkPrunedFiles deleted blk/rev (00000)
    Prune: UnlinkPrunedFiles deleted blk/rev (00001)
    Prune: UnlinkPrunedFiles deleted blk/rev (00002)
    Prune: UnlinkPrunedFiles deleted blk/rev (00003)
    Prune: UnlinkPrunedFiles deleted blk/rev (00004)
    Prune: UnlinkPrunedFiles deleted blk/rev (00005)
    Prune: UnlinkPrunedFiles deleted blk/rev (00006)
    
  5. laanwj commented at 7:25 AM on July 27, 2015: member

    Looks good to me. utACK

  6. laanwj commented at 9:09 AM on July 27, 2015: member

    A small nit: this puts the pruning operation under the init message Loading Wallet, and also under Step 8: load wallet in the source code - while it has nothing to do with the wallet. As this can take a while, and also to keep clear separation, it may be better to add an InitMessage call on top and put it in its own logical step.

  7. ajweiss commented at 5:56 PM on July 27, 2015: contributor

    SGTM. I lean towards something a little more generic like "Performing data directory maintenance..." as opposed to "Pruning blockstore..." as it would allow for other similar data directory management tasks to be added in future without creating more translation work. Although, the others aren't as generic. Do you have a preference?

  8. Delay initial pruning until after wallet init
    Don't prune until any wallet rescanning has taken place to avoid
    potentially pruning blocks that the wallet rescan may need.
    f0cba6f8eb
  9. ajweiss force-pushed on Jul 29, 2015
  10. ajweiss commented at 6:03 PM on July 29, 2015: contributor

    Ok, pushed. I used "Pruning blockstore..." for now as it's more in line with the descriptiveness of the other init messages. If there's objection, I can change it to something more generic.

  11. laanwj commented at 5:21 PM on August 3, 2015: member

    @ajweiss Agreed that a more general categorization is a good idea, also to make localization easier. But yes at the moment the messages are very specific, so this is most consistent.

  12. laanwj merged this on Aug 3, 2015
  13. laanwj closed this on Aug 3, 2015

  14. laanwj referenced this in commit 9e6c33b202 on Aug 3, 2015
  15. MarcoFalke 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-04-20 09:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me