Page MenuHomePhabricator

Introduce the strongly typed enum BlockValidity to represent the validity of a block
ClosedPublic

Authored by deadalnix on May 23 2018, 13:20.

Details

Summary

Use it as parameter to IsValid and RaiseValidity. The type safety allows us to remove some asserts as they are now invariant of the type system.

Test Plan
make check
./test/functional/test_runner.py --extended

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Fix a problem where the wrong flag was checked (kind of scary no test is catching this).

schancel added inline comments.
src/chain.h
133 ↗(On Diff #3948)

What's this?

191 ↗(On Diff #3948)

These are doxygen comments, please don't remove them.

391 ↗(On Diff #3948)

Why is this using bitmasks at all? Because we're storing failed flags in the same place? Wouldn't nStatus >= nUpTo be sufficient?

schancel requested changes to this revision.May 24 2018, 19:00
This revision now requires changes to proceed.May 24 2018, 19:00
This revision is now accepted and ready to land.May 25 2018, 14:12
This revision was automatically updated to reflect the committed changes.