remove GetEstimatedMasternodes and GetTotalCoinEstimate (#1258)
This commit is contained in:
parent
a42b375a05
commit
621f9ebeca
25
src/main.cpp
25
src/main.cpp
@ -1704,31 +1704,6 @@ double ConvertBitsToDouble(unsigned int nBits)
|
|||||||
return dDiff;
|
return dDiff;
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t GetTotalCoinEstimate(int nHeight)
|
|
||||||
{
|
|
||||||
int64_t nTotalCoins = 0;
|
|
||||||
|
|
||||||
// TODO: This could be vastly improved, look at GetBlockValue for a better method
|
|
||||||
|
|
||||||
/* these values are taken from the block explorer */
|
|
||||||
if(nHeight > 5076) nTotalCoins += 2021642;
|
|
||||||
if(nHeight > 17000) nTotalCoins += 3267692-2021642;
|
|
||||||
if(nHeight > 34000) nTotalCoins += 3688775-3267692;
|
|
||||||
if(nHeight > 68000) nTotalCoins += 4277615-3688775;
|
|
||||||
|
|
||||||
if(nHeight > 68000*2) {
|
|
||||||
nTotalCoins += 4649913.99999995-4277615;
|
|
||||||
} else {
|
|
||||||
return nTotalCoins;
|
|
||||||
}
|
|
||||||
|
|
||||||
//5.383754730451325 per block average after this
|
|
||||||
nTotalCoins += ((nHeight-68000*2)*((5382104.64334133-4649913.99999995)/(68000*2)));
|
|
||||||
|
|
||||||
// TODO: this should include the 7.1% decline too
|
|
||||||
return nTotalCoins;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
NOTE: unlike bitcoin we are using PREVIOUS block height here,
|
NOTE: unlike bitcoin we are using PREVIOUS block height here,
|
||||||
might be a good idea to change this to use prev bits
|
might be a good idea to change this to use prev bits
|
||||||
|
@ -251,7 +251,6 @@ bool GetTransaction(const uint256 &hash, CTransaction &tx, const Consensus::Para
|
|||||||
bool ActivateBestChain(CValidationState& state, const CChainParams& chainparams, const CBlock* pblock = NULL);
|
bool ActivateBestChain(CValidationState& state, const CChainParams& chainparams, const CBlock* pblock = NULL);
|
||||||
|
|
||||||
double ConvertBitsToDouble(unsigned int nBits);
|
double ConvertBitsToDouble(unsigned int nBits);
|
||||||
int64_t GetTotalCoinEstimate(int nHeight);
|
|
||||||
CAmount GetBlockSubsidy(int nBits, int nHeight, const Consensus::Params& consensusParams, bool fSuperblockPartOnly = false);
|
CAmount GetBlockSubsidy(int nBits, int nHeight, const Consensus::Params& consensusParams, bool fSuperblockPartOnly = false);
|
||||||
CAmount GetMasternodePayment(int nHeight, CAmount blockValue);
|
CAmount GetMasternodePayment(int nHeight, CAmount blockValue);
|
||||||
|
|
||||||
|
@ -348,21 +348,6 @@ void CMasternodeSync::ProcessTick()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for data
|
|
||||||
// if we have enough masternodes in or list, switch to the next asset
|
|
||||||
/* Note: Is this activing up? It's probably related to int CMasternodeMan::GetEstimatedMasternodes(int nBlock)
|
|
||||||
Surely doesn't work right for testnet currently */
|
|
||||||
// try to fetch data from at least two peers though
|
|
||||||
int nMnCountEstimated = mnodeman.GetEstimatedMasternodes(pCurrentBlockIndex->nHeight)*0.9;
|
|
||||||
LogPrintf("CMasternodeSync::ProcessTick -- nTick %d nMnCount %d nMnCountEstimated %d\n",
|
|
||||||
nTick, nMnCount, nMnCountEstimated);
|
|
||||||
if(nRequestedMasternodeAttempt > 1 && nMnCount > nMnCountEstimated) {
|
|
||||||
LogPrintf("CMasternodeSync::ProcessTick -- nTick %d nRequestedMasternodeAssets %d -- found enough data\n", nTick, nRequestedMasternodeAssets);
|
|
||||||
SwitchToNextAsset();
|
|
||||||
ReleaseNodes(vNodesCopy);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// only request once from each peer
|
// only request once from each peer
|
||||||
if(netfulfilledman.HasFulfilledRequest(pnode->addr, "masternode-list-sync")) continue;
|
if(netfulfilledman.HasFulfilledRequest(pnode->addr, "masternode-list-sync")) continue;
|
||||||
netfulfilledman.AddFulfilledRequest(pnode->addr, "masternode-list-sync");
|
netfulfilledman.AddFulfilledRequest(pnode->addr, "masternode-list-sync");
|
||||||
|
@ -1327,28 +1327,6 @@ std::string CMasternodeMan::ToString() const
|
|||||||
return info.str();
|
return info.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
int CMasternodeMan::GetEstimatedMasternodes(int nBlock)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
Masternodes = (Coins/1000)*X on average
|
|
||||||
|
|
||||||
*X = nPercentage, starting at 0.52
|
|
||||||
nPercentage goes up 0.01 each period
|
|
||||||
Period starts at 35040, which has exponential slowing growth
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
int nPercentage = 52; //0.52
|
|
||||||
int nPeriod = 35040;
|
|
||||||
int nCollateral = 1000;
|
|
||||||
|
|
||||||
for (int i = nPeriod; i <= nBlock; i += nPeriod) {
|
|
||||||
nPercentage++;
|
|
||||||
nPeriod*=2;
|
|
||||||
}
|
|
||||||
return (GetTotalCoinEstimate(nBlock)/100*nPercentage/nCollateral);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CMasternodeMan::UpdateMasternodeList(CMasternodeBroadcast mnb)
|
void CMasternodeMan::UpdateMasternodeList(CMasternodeBroadcast mnb)
|
||||||
{
|
{
|
||||||
LOCK(cs);
|
LOCK(cs);
|
||||||
|
@ -310,8 +310,6 @@ public:
|
|||||||
|
|
||||||
std::string ToString() const;
|
std::string ToString() const;
|
||||||
|
|
||||||
int GetEstimatedMasternodes(int nBlock);
|
|
||||||
|
|
||||||
/// Update masternode list and maps using provided CMasternodeBroadcast
|
/// Update masternode list and maps using provided CMasternodeBroadcast
|
||||||
void UpdateMasternodeList(CMasternodeBroadcast mnb);
|
void UpdateMasternodeList(CMasternodeBroadcast mnb);
|
||||||
/// Perform complete check and only then update list and maps
|
/// Perform complete check and only then update list and maps
|
||||||
|
Loading…
Reference in New Issue
Block a user