Skip to content

Conversation

@sipa
Copy link
Member

@sipa sipa commented Jan 30, 2013

Split off InitBlockIndex from LoadBlockIndex, and call it again after finishing reindexing. This makes sure -reindex on an empty datadir still ends up with a sane database.

Also, protecting the initialization with a try-catch block.

@gavinandresen
Copy link
Contributor

ACK.

Tested; fixes #2228 and #2239

@sipa
Copy link
Member Author

sipa commented Jan 30, 2013

No way this fixes #2228 ...

@gavinandresen
Copy link
Contributor

@sipa : I stand corrected: it fixes a variant of #2228 where no IBD was done if you start with an empty data directory and -reindex.

@sipa
Copy link
Member Author

sipa commented Jan 30, 2013

Ok, that seems plausible.

@gavinandresen
Copy link
Contributor

I take back my ACK: this breaks unit tests. TestingSetup() in test/test_bitcoin.cpp needs to call InitBlockIndex, I think.

@sipa
Copy link
Member Author

sipa commented Feb 1, 2013

Fixed.

@BitcoinPullTester
Copy link

@gavinandresen gavinandresen merged commit 3860376 into bitcoin:master Feb 5, 2013
@sipa sipa deleted the reindexgen branch May 3, 2013 18:50
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants