Set mock time before creating block template in validation_block_tests, rather than setting it after the template has been built. This ensures the time used when calculating difficulty bits matches the time on the block after mining.
test: Set mock time before creating block #21998
pull rnicoll wants to merge 1 commits into bitcoin:master from rnicoll:validate-block-test-time changing 1 files +1 −1-
rnicoll commented at 6:36 PM on May 19, 2021: contributor
-
eeb58e2b55
Set mock time before creating block
Set mock time before creating block template in validation_block_tests, rather than setting it after the template has been built. This ensures the time used when calculating difficulty bits matches the time on the block after mining.
- DrahtBot added the label Tests on May 19, 2021
-
MarcoFalke commented at 6:01 AM on May 20, 2021: member
Regtest doesn't have difficulty adjustments
-
rnicoll commented at 8:17 AM on May 20, 2021: contributor
The tests as-is do not reach a point where the difficulty changes, which is why this doesn't make a difference to the outcome, but this patch comes from experimenting with retarget interval causing this test to fail.
-
MarcoFalke commented at 8:38 AM on May 20, 2021: member
~0. Looks good, but it might be better to submit this as part of the pull request that changes the retarget
-
rnicoll commented at 11:22 AM on May 22, 2021: contributor
As you had probably guessed, I had in fact broken the no-retarget logic. Closing.
- rnicoll closed this on May 22, 2021
- rnicoll deleted the branch on May 22, 2021
- DrahtBot locked this on Aug 18, 2022
Contributors
Labels