https://github.com/bitcoin/bitcoin/pull/16404/commits/aa2622a726bc0f02152d79c888a332694678a989
Partial backport of Core PR16404 and PR16740 (PR16404 on its own is broken and will not pass the tests otherwise, sorry)
notes:
* test looks to be wrong. socket.connect() is running before there is a node with the proper -zmqxx=xx CLI parameters set, so I moved it accordingly.