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 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 invalid-chain-found branch from f3a2655 to c433828 Compare July 22, 2015 21:10
@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
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 invalid-chain-found branch March 13, 2018 08:44
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants