mirror of
https://github.com/dashpay/dash.git
synced 2024-12-29 13:59:06 +01:00
better calculation for election
This commit is contained in:
parent
9ea042a12a
commit
2242763cbc
14
src/main.cpp
14
src/main.cpp
@ -1581,7 +1581,7 @@ unsigned int static GetNextWorkRequired(const CBlockIndex* pindexLast, const CBl
|
||||
{
|
||||
int DiffMode = 1;
|
||||
if (fTestNet) {
|
||||
if (pindexLast->nHeight+1 >= 15) { DiffMode = 4; }
|
||||
if (pindexLast->nHeight+1 >= 430) { DiffMode = 4; }
|
||||
else if (pindexLast->nHeight+1 >= 5) { DiffMode = 3; }
|
||||
}
|
||||
else {
|
||||
@ -5854,6 +5854,18 @@ void CDarkSendPool::RegisterAsMasterNode()
|
||||
}
|
||||
}
|
||||
|
||||
uint256 CMasterNode::CalculateScore()
|
||||
{
|
||||
if(pindexBest == NULL) return 0;
|
||||
|
||||
int nVersion = 1;
|
||||
uint256 n1 = pindexBest->GetBlockHash();
|
||||
uint256 n2 = Hash9(BEGIN(nVersion), END(n1));
|
||||
uint256 n3 = vin.prevout.hash > n2 ? (vin.prevout.hash - n2) : (n2 - vin.prevout.hash);
|
||||
printf(" -- MasterNode CalculateScore() = %s \n", n3.ToString().c_str());
|
||||
return n3;
|
||||
}
|
||||
|
||||
|
||||
void ThreadCheckDarkSendPool()
|
||||
{
|
||||
|
@ -2311,14 +2311,7 @@ public:
|
||||
newVin = newVin;
|
||||
}
|
||||
|
||||
uint256 CalculateScore()
|
||||
{
|
||||
if(pindexBest == NULL) return 0;
|
||||
|
||||
uint256 n = vin.prevout.hash > pindexBest->GetBlockHash() ? (vin.prevout.hash - pindexBest->GetBlockHash()) : (pindexBest->GetBlockHash() - vin.prevout.hash);
|
||||
printf(" -- MasterNode CalculateScore() = %s \n", n.ToString().c_str());
|
||||
return n;
|
||||
}
|
||||
uint256 CalculateScore();
|
||||
|
||||
void UpdateLastSeen()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user