libbitcoin/libbitcoin-database

Move block pool into block store.

Closed this issue · 1 comments

Use the height index to maintain the long chain. Use height sentinel in pooled blockes, just as with position sentinel in pooled txs. Allow queries to require "confirmed" blocks just as with require_confirmed txs.

This eliminates the need for the fork class and turns block validation into a simple single block operation, just as with tx validation. A new block that descends from an unconfirmed block is tested for fork point by walking back to the first confirmed ancestor. On a reorg the block height values are updated in the hash table for both in/out confirmations and the height index is updated similarly.

Complete for v4.