-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
blockchain: moved chainwork to blockindex #213
blockchain: moved chainwork to blockindex #213
Conversation
6ad84a9
to
7ac5895
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK. Tested on x86_64-pc-linux-gnu and all tests pass. Ran that through valgrind and no leaks. Ran valgrind on spvnode and no leaks.
7ac5895
to
bfe0fd4
Compare
block: removed chainwork from block header block: added chainwork parameter to deserialize functions chainparams: added chainwork to genesis blocks and checkpoints headersdb: added chainwork parameter to set_chainpoint_start headersdb_file: added chainwork to genesis block and checkpoint spv: added chainwork parameter to set checkpoint validation: added chainwork parameter to check_auxpow arith_uint256: updated add and sub_arith_uint256 to work from LSB arith_uint256: updated set_compact to direct assignment arith_uint256: updated sub_arith_uint256 to unsigned borrow arith_uint256: updated sub_arith_uint256 to handle underflow arith_uint256: added arith_shift functions to header pow: updated target check with arith_uint256_is_zero pow: updated uint256_cmp to work from MSB to LSB pow: updated check_pow to swap_bytes in hash tests: updated net and block tests tests: added arith_uint256 tests make: added arith_uint256 tests
bfe0fd4
to
2a29278
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-ACK. Tested on x86_64 jammy.
998a68d
to
8eea8bd
Compare
headersdb_file: added chainwork to load and write headersdb_file: updated chainwork check on reorg headersdb_file: updated current version for chainwork headersdb_file: updated load to connect first header tests: updated reorg_test to load and write headers
8eea8bd
to
ddac774
Compare
Did soft-review on files, and looking at proof of operation from prev reviews, LGTM merge. |
Refactored
chainwork
by moving it from the block header to block index and updated related functions and tests accordingly.