HomePhabricator

Fixes a race condition in CreateNewBlock and a future null deref on testnet.
faff50d129b6Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Fixes a race condition in CreateNewBlock and a future null deref on testnet.

CreateNewBlock was reading pindexBest at the start before taking the lock
so it was possible to have the the block content not match the prevheader
and this can also trigger a newly added assert in ConnectBlock.

I noticed this during a code review after twobitcoins reported that ab91bf39
(BIP30 for all blocks) could cause a null dereference on a modified node
that mined during the IBD, or on testnet when it reached heights 91842 and
91880 due to CreateNewBlock calling ConnectBlock with pindex->phashBlock NULL.

Details

Provenance
Gregory Maxwell <greg@xiph.org>Authored on Oct 24 2012, 05:41
schancelPushed on Jan 5 2018, 21:58
schancelPushed on Jan 5 2018, 21:39
schancelPushed on Jan 5 2018, 21:17
Parents
rSTAGING675a39fc4f24: Merge pull request #1942 from Diapolo/rem_dup_txdb_h
Branches
Unknown
Tags
Unknown

Event Timeline