MCPcopy Create free account
hub / github.com/LUX-Core/lux / CalculateScore

Method CalculateScore

src/masternode.cpp:730–741  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

728}
729
730uint64_t CMasternodePayments::CalculateScore(uint256 blockHash, CTxIn& vin) {
731 uint256 n1 = blockHash;
732 uint256 n2 = Hash(BEGIN(n1), END(n1));
733 uint256 n3 = Hash(BEGIN(vin.prevout.hash), END(vin.prevout.hash));
734 uint256 n4 = n3 > n2 ? (n3 - n2) : (n2 - n3);
735
736 LogPrintf(" -- CMasternodePayments CalculateScore() n2 = %d \n", n2.Get64());
737 LogPrintf(" -- CMasternodePayments CalculateScore() n3 = %d \n", n3.Get64());
738 LogPrintf(" -- CMasternodePayments CalculateScore() n4 = %d \n", n4.Get64());
739
740 return n4.Get64();
741}
742
743bool CMasternodePayments::GetBlockPayee(int nBlockHeight, CScript& payee) {
744 for (CMasternodePaymentWinner& winner : vWinning) {

Callers 3

GetCurrentMasterNodeFunction · 0.80
GetMasternodeByRankFunction · 0.80
GetMasternodeRankFunction · 0.80

Calls 2

Get64Method · 0.80
HashFunction · 0.70

Tested by

no test coverage detected