There doesn’t seem to be any benefit to creating the cached data directories with old timestamps, but it does seem to interfere with tests because nodes using the cached chain were starting off in IBD, which interferes with chain sync.
This PR changes the cache to use current timestamps. One test seemed to be relying on the blocks in the cache being old, so I modified it to explicitly create old blocks.
Changing the cache to use recent timestamps – and thus have nodes be out of IBD on startup – fixes a bug in the wallet_txn_doublespend.py test, noted in #14446. Block sync to a node in IBD might fail because we are willing to wait a long time for our headers-sync peer to respond before we send getheaders messages to other peers. In wallet_txn_doublespend.py, the test tries to workaround this issue by mining a block after connection, which happens to trigger the IBD-node to send a getheaders after receiving the block INV. However, there is a race, where node connection and initial handshake could take longer than the call to generate the block, resulting in no block announcement going to the IBD peer, causing test failure.