From 5f5ee7a59bbcea34d6d8765ebe79a9b5ba52a439 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Tue, 9 Jun 2015 19:37:58 +0300 Subject: [PATCH] fix CFinalizedBudgetVote and CBudgetVote hashing, see https://github.com/dashpay/dash/pull/357 for more info --- src/masternode-budget.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/masternode-budget.h b/src/masternode-budget.h index 8460eb933a..9b3c7f56be 100644 --- a/src/masternode-budget.h +++ b/src/masternode-budget.h @@ -304,7 +304,11 @@ public: void Relay(); uint256 GetHash(){ - return Hash(BEGIN(vin), END(vin), BEGIN(nBudgetHash), END(nBudgetHash), BEGIN(nTime), END(nTime)); + CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION); + ss << vin; + ss << nBudgetHash; + ss << nTime; + return ss.GetHash(); } ADD_SERIALIZE_METHODS; @@ -479,7 +483,12 @@ public: } uint256 GetHash(){ - return Hash(BEGIN(vin), END(vin), BEGIN(nProposalHash), END(nProposalHash), BEGIN(nVote), END(nVote), BEGIN(nTime), END(nTime)); + CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION); + ss << vin; + ss << nProposalHash; + ss << nVote; + ss << nTime; + return ss.GetHash(); } ADD_SERIALIZE_METHODS;