Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle no chain tip available in InvalidChainFound() #6377

Merged
merged 1 commit into from Aug 7, 2015

Conversation

@rnicoll
Copy link
Contributor

rnicoll commented Jul 4, 2015

Handle the case where no chain tip is available, in InvalidChainFound(). This fixes a null pointer deference when running unit tests, if the genesis block or block validation code is broken.

@laanwj
Copy link
Member

laanwj commented Jul 21, 2015

The initialization takes care that the node will not be started as long as the chain tip is NULL (see #5243). So this is not a case that should happen.

Maybe add an assert(tip) instead?

@laanwj laanwj added the Tests label Jul 21, 2015
Handle the case where no chain tip is available, in InvalidChainFound(). This fixes a null pointer deference when running unit tests, if the genesis block or block validation code is broken.
@rnicoll rnicoll force-pushed the rnicoll:invalid-chain-found branch to c433828 Jul 22, 2015
@rnicoll
Copy link
Contributor Author

rnicoll commented Jul 22, 2015

Done - it still core dumps, but it's clear about where the failure was, at least (i.e. you don't have to dig out gdb to trace down what went wrong).

@laanwj
Copy link
Member

laanwj commented Jul 23, 2015

Well it is meant to be fatal if it gets there with a NULL chaintip. Dumping core on abort() is a feature, not a bug.
utACK

@laanwj laanwj merged commit c433828 into bitcoin:master Aug 7, 2015
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
laanwj added a commit that referenced this pull request Aug 7, 2015
c433828 Handle no chain tip available in InvalidChainFound() (Ross Nicoll)
@rnicoll rnicoll deleted the rnicoll:invalid-chain-found branch Mar 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.