Ori Newman 2abd4a274b
[NOD-1496] Implement headers only verification (#987)
* [NOD-1496] Implement headers only verification

* [NOD-1496] Add checkParentsExist

* [NOD-1496] Stage block statuses in block processor

* [NOD-1496] Rename AddBlock->AddHeaderTip

* [NOD-1496] Return early from validateAndInsertBlock on header only and put ValidateProofOfWorkAndDifficulty inside validateBlock
2020-11-02 16:30:59 +02:00

27 lines
909 B
Go

package externalapi
// BlockStatus represents the validation state of the block.
type BlockStatus byte
const (
// StatusInvalid indicates that the block is invalid.
StatusInvalid BlockStatus = iota
// StatusValid indicates that the block has been fully validated.
StatusValid
// StatusValidateFailed indicates that the block has failed validation.
StatusValidateFailed
// StatusUTXOPendingVerification indicates that the block is pending verification against its past UTXO-Set, either
// because it was not yet verified since the block was never in the selected parent chain, or if the
// block violates finality.
StatusUTXOPendingVerification
// StatusDisqualifiedFromChain indicates that the block is not eligible to be a selected parent.
StatusDisqualifiedFromChain
// StatusHeaderOnly indicates that the block transactions are not held (pruned or wasn't added yet)
StatusHeaderOnly
)