#30681 fixed the curtime field of getblocktemplate to take the timewarp rule into account. However I forgot to do the same for the mintime field, which was hardcoded to use pindexPrev->GetMedianTimePast()+1.
This PR adds a helper GetMinimumTime() and uses it for the mintime field.
#31376 changed the curtime field to always account for the timewarp rule. This PR maintains that behavior.
Note that mintime now always applies BIP94, including on mainnet. This makes future softfork activation safer.
It could be backported to v28.