Skip to content

Commit

Permalink
Merge branch 'v0.12.2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
GoByteDev committed Jun 10, 2018
2 parents 1c94174 + a7c0c9d commit 0cdec49
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/masternode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0cdec49

Please sign in to comment.