Initialize database before checking changed txindex #2783

pull sipa wants to merge 1 commits into bitcoin:master from sipa:newtxindex changing 1 files +6 −6
  1. sipa commented at 2:08 PM on June 22, 2013: member

    In case no database exists yet, and -txindex(=1) is passed, we currently first check whether fTxIndex differs from -txindex (and ask the user to reindex in that case), and only afterwards initialize the database. By swapping these around (the initialization is a no-op in case the database already exists), we allow it to be born in txindex mode, without warning.

    That also means we don't need to check -reindex anymore, as the wiping/reinit of the databases happens before checking.

    Closes #2782.

    Tested all 8 combinations of the database already existing or not, -reindex passed or not, -txindex set or not.

  2. Initialize database before checking changed txindex
    In case no database exists yet, and -txindex(=1) is passed, we currently first
    check whether fTxIndex differs from -txindex (and ask the user to reindex in
    that case), and only afterwards initialize the database. By swapping these
    around (the initialization is a no-op in case the database already exists),
    we allow it to be born in txindex mode, without warning.
    
    That also means we don't need to check -reindex anymore, as the wiping/reinit
    of the databases happens before checking.
    067a6092ac
  3. Diapolo commented at 4:14 PM on June 23, 2013: none

    Yeah, seems like a better place for the check.

  4. jgarzik commented at 7:48 PM on June 23, 2013: contributor

    ACK

  5. sipa referenced this in commit fd967fed89 on Jun 23, 2013
  6. sipa merged this on Jun 23, 2013
  7. sipa closed this on Jun 23, 2013

  8. Bushstar referenced this in commit 12274e578a on Apr 5, 2019
  9. DrahtBot 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-19 09:15 UTC

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