Use correct protocol when serializing messages in reply to getdata (#2157)

Messages should be serialized according the protocol of the peer who asked us or otherwise peers running on other protocols won't be able to deserialize the message correctly.
This commit is contained in:
UdjinM6 2018-06-30 21:18:37 +03:00 committed by GitHub
parent 4dbde218b9
commit fda74b4a8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1218,7 +1218,7 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
if (!push && inv.type == MSG_GOVERNANCE_OBJECT) {
LogPrint("net", "ProcessGetData -- MSG_GOVERNANCE_OBJECT: inv = %s\n", inv.ToString());
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
CDataStream ss(SER_NETWORK, pfrom->GetSendVersion());
bool topush = false;
{
if(governance.HaveObjectForHash(inv.hash)) {
@ -1236,7 +1236,7 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
}
if (!push && inv.type == MSG_GOVERNANCE_OBJECT_VOTE) {
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
CDataStream ss(SER_NETWORK, pfrom->GetSendVersion());
bool topush = false;
{
if(governance.HaveVoteForHash(inv.hash)) {