Permalink
Browse files

Merge branch 'v0.12.2.3'

  • Loading branch information...
GoByteDev committed Jun 10, 2018
2 parents 1c94174 + a7c0c9d commit 0cdec490ac3fe1bcdfdb3390d204ecb36f5b73f0
Showing with 0 additions and 14 deletions.
  1. +0 −14 src/masternode.cpp
View
@@ -96,24 +96,10 @@ bool CMasternode::UpdateFromNewBroadcast(CMasternodeBroadcast& mnb, CConnman& co
//
arith_uint256 CMasternode::CalculateScore(const uint256& blockHash)
{
/* NEW SYSTEM BUT NOT COMPATIBLE WITH THE CURRENT ONE - GOBYTE
// Deterministically calculate a "score" for a Masternode based on any given (block)hash
CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION);
ss << vin.prevout << nCollateralMinConfBlockHash << blockHash;
return UintToArith256(ss.GetHash());
*/
uint256 aux = ArithToUint256(UintToArith256(vin.prevout.hash) + vin.prevout.n);
CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION);
ss << blockHash;
arith_uint256 hash2 = UintToArith256(ss.GetHash());
CHashWriter ss2(SER_GETHASH, PROTOCOL_VERSION);
ss2 << blockHash;
ss2 << aux;
arith_uint256 hash3 = UintToArith256(ss2.GetHash());
return (hash3 > hash2 ? hash3 - hash2 : hash2 - hash3);
}
CMasternode::CollateralStatus CMasternode::CheckCollateral(const COutPoint& outpoint)

0 comments on commit 0cdec49

Please sign in to comment.