zawy has noted a class of devastating attacks that are possible on
some difficulty algorithms when block timestamps are allowed to vary
nonmonotonicaly. There appear to be a few ways to stop it:
- Use an exploit-free difficulty algorithm.
- Reject deep reorgs.
- Prevent nonmonotonic timestamps.
This diff includes all necessary changes to C++ it takes to permit
monotonic timestamps -- the third option above.
Incidentally, there was only one test that
was explicitly testing the median timestamp rule on regtest, but several
others that were (unnecessarily) relying on it.
TODO: add a functional test for the activation