diff --git a/src/masternode.cpp b/src/masternode.cpp index 5928aba9a..b425b09c4 100644 --- a/src/masternode.cpp +++ b/src/masternode.cpp @@ -159,8 +159,14 @@ uint256 CMasternode::CalculateScore(int mod, int64_t nBlockHeight) if(!GetBlockHash(hash, nBlockHeight)) return 0; - uint256 hash2 = Hash(BEGIN(hash), END(hash)); - uint256 hash3 = Hash(BEGIN(hash), END(hash), BEGIN(aux), END(aux)); + CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION); + ss << hash; + uint256 hash2 = ss.GetHash(); + + CHashWriter ss2(SER_GETHASH, PROTOCOL_VERSION); + ss2 << hash; + ss2 << aux; + uint256 hash3 = ss2.GetHash(); uint256 r = (hash3 > hash2 ? hash3 - hash2 : hash2 - hash3);