Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
Credit BlueMatt for libbitcoinsonsensus.h/cpp