Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix disk block index for non-zero nNonce values.
After the post-ICO fork, nNonce values in blocks are allowed to be non-zero. This is fine from a consensus point of view (and was tested), but it caused corruption to the on-disk block index. The reason for this is that the nNonce value was not included in the C(Disk)BlockIndex instances, and was assumed to be zero when computing the block hash from a CDiskBlockIndex that is being loaded. Thus blocks would be inserted into mapBlockIndex at a wrong hash, so that the pprev pointer of the next block (referring to the correct block index) was pointing to an empty struct instead. This fix adds back nNonce to C(Disk)BlockIndex, so that all works fine. Users who synced beyond the first affected block (529761 on mainnet). See also #82.
- Loading branch information
Showing
4 changed files
with
23 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters