we are playing with the regtest and we don't able to replicate the two blocks validation error managed here https://github.com/bitcoin/bitcoin/blob/5b24f6084ede92d0f493ff416b4726245140b2c1/src/validation.cpp#L3493-L3499
We understand that GetBlockTime
and nAdjustedTime
have values near os now()
time so move manually the os clock can trigger the validation errors.
But we were unable to :(
Step to reproduce "time-too-old"
- start bitcoin regtest daemon
- mine 101 block
- change the os clock 1h behind
- mine a new block
we expect to get "time-too-old" validation error but we got no error
Step to reproduce "time-too-new"
- start bitcoin regtest daemon
- mine 101 blocks
- change the os clock 3h forward
- mine a new block
we expect to get "time-too-new" validation error but we got no error