Although a node during IBD will not request transactions from peers, it
is possible for it to be sent unsolicited transactions from peers, or,
some RPC method might try to inject a transaction into the mempool.
When we are before UAHF, this will end up rejecting transactions due to
mismatching sighash. But this is only due to a last-minute check and this
will generate some harmless but scary sounding "BUG! PLEASE REPORT THIS!"
So, just as a sanity check, we can fast-reject all transactions when our
chain is before the UAHF. Even if some transactions were to be accepted,
they would likely just end up slowing down IBD anyway (since mempool needs
to keep getting updated) and anyway, the tx would likely end up getting
discarded by some double spent conflict.
As a result, the scary log message should only appear in actually
Note: it is not really possible to unit test this error code since regtest
UAHF activates at height=0; however we can try putting in graviton
activation instead, which causes a fair number of functional tests to fail,
not just the graviton activation tests, but also some other tests that use
the 'setup chain' and don't drive themselves out of IBD. There are some
future backports that will make tests start out of IBD, by default. Until
then this rejection has to be restricted to activations that occur at
height=0 on regtest.