Skip to content

Handle no chain tip available in InvalidChainFound() - #6377

Merged
laanwj merged 1 commit into
bitcoin:masterfrom
rnicoll:invalid-chain-found
Aug 7, 2015
Merged

Handle no chain tip available in InvalidChainFound()#6377
laanwj merged 1 commit into
bitcoin:masterfrom
rnicoll:invalid-chain-found

Conversation

@rnicoll

@rnicoll rnicoll commented Jul 4, 2015

Copy link
Copy Markdown

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

laanwj commented Jul 21, 2015

Copy link
Copy Markdown
Member

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

rnicoll commented Jul 22, 2015

Copy link
Copy Markdown
Author

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

laanwj commented Jul 23, 2015

Copy link
Copy Markdown
Member

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