Bitcoin pull #2738 changes applied to Peercoin codebase including tests