A revival of #19434 but with a few substantial changes.
The code is valuable but from my understanding, it is offset by the workaround code from #11593. So I have wrapped the code so it’s only used for versions where the workaround does not apply. The original PR removed the workaround code but also led to failures in test/functional/mining_getblocktemplate_longpoll.py
so I think this is not an option.
Since libevent
2.2 is still not out and it’s hard to say when that will happen I am putting this into draft mode.