HomePhabricator

Make FindBlockByHeight constant-time.
0fe8010a10baUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Make FindBlockByHeight constant-time.

Remove the pnext pointer in CBlockIndex, and replace it with a
vBlockIndexByHeight vector (no effect on memory usage). pnext can
now be replaced by vBlockIndexByHeight[nHeight+1], but
FindBlockByHeight becomes constant-time.

This also means the entire mapBlockIndex structure and the block
index entries in it become purely blocktree-related data, and
independent from the currently active chain, potentially allowing
them to be protected by separate mutexes in the future.

Details

Provenance
Pieter Wuille <pieter.wuille@gmail.com>Authored on May 12 2013, 13:50
deadalnixPushed on May 14 2017, 22:04
Parents
rABC5b5d399593ad: Update version numbers for 0.8.2rc1 release
Branches
Unknown
Tags
Unknown

Event Timeline

Pieter Wuille <pieter.wuille@gmail.com> committed rABC0fe8010a10ba: Make FindBlockByHeight constant-time. (authored by Pieter Wuille <pieter.wuille@gmail.com>).May 12 2013, 17:52