HomePhabricator

Rewrite CreateNewBlock
553cad94e29cUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Rewrite CreateNewBlock

Use the score index on the mempool to only add sorted txs in order. Remove much of the validation while building the block, relying on mempool to be consistent and only contain txs that can be mined.
The mempool is assumed to be consistent as far as not containing txs which spend non-existent outputs or double spends, and scripts are valid. Finality of txs is still checked (except not coinbase maturity, assumed in mempool).
Still TestBlockValidity in case mempool consistency breaks and return error state if an invalid block was created.
Unit tests are modified to realize that invalid blocks can now be constructed if the mempool breaks its consistency assumptions and also updated to have the right fees, since the cached value is now used for block construction.

Conflicts:
src/miner.cpp

Details

Provenance
Alex Morcos <morcos@chaincode.com>Authored on Nov 3 2015, 15:35
deadalnixPushed on May 14 2017, 22:04
Parents
rABC5f122633020c: Expose FormatStateMessage
Branches
Unknown
Tags
Unknown

Event Timeline

Alex Morcos <morcos@chaincode.com> committed rABC553cad94e29c: Rewrite CreateNewBlock (authored by Alex Morcos <morcos@chaincode.com>).Dec 1 2015, 17:09