clean up the handshake to be consistent with the Satoshi client