works on full sync

This commit is contained in:
Brannon King 2020-04-17 10:25:51 -06:00
parent bab4fd1648
commit f81c74f820
3 changed files with 17 additions and 14 deletions

View file

@ -3,7 +3,7 @@ AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 0)
define(_CLIENT_VERSION_MINOR, 17)
define(_CLIENT_VERSION_REVISION, 4)
define(_CLIENT_VERSION_BUILD, 4)
define(_CLIENT_VERSION_BUILD, 5)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2019)
define(_COPYRIGHT_HOLDERS,[The %s developers])

View file

@ -166,10 +166,10 @@ public:
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1548288000; // Jan 24, 2019
// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0000000000000000000000000000000000000000000002bfdb5232f364d6774e"); //700k
consensus.nMinimumChainWork = uint256S("0000000000000000000000000000000000000000000003253077412df5b49766"); //749k
// By default assume that the signatures in ancestors of this block are valid.
consensus.defaultAssumeValid = uint256S("beaf6432c9a7be3ea8c333bd7a90d4b3e07b0f20c86aa2e5dfebc9eba340201c"); //700k
consensus.defaultAssumeValid = uint256S("b9676f45be594438a2011407c93bb530d817fa365846e7a6ecdf2790e4a0ad6b"); //749k
/**
* The message start string is designed to be unlikely to occur in normal data.
@ -287,10 +287,10 @@ public:
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1585849000; // Apr 2nd 2020
// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000000000000004f6bb06a9");
consensus.nMinimumChainWork = uint256S("00000000000000000000000000000000000000000000000000000054b7d280af"); // 8400
// By default assume that the signatures in ancestors of this block are valid.
consensus.defaultAssumeValid = uint256S("0x079557d16edcd640c4057c9fddb81257263014fe384c4aa348c5b9d190650a46"); // 14
consensus.defaultAssumeValid = uint256S("50b68b892f4e0f2ef649df37ef10b702e826c8913cc785c5e8ec16dd6be83f8b"); // 8400
pchMessageStart[0] = 0xfa;
pchMessageStart[1] = 0xe4;
@ -371,8 +371,8 @@ public:
consensus.nAllowMinDiffMinHeight = -1;
consensus.nAllowMinDiffMaxHeight = -1;
consensus.nNormalizedNameForkHeight = 250; // SDK depends upon this number
consensus.nMinRemovalWorkaroundHeight = 0;
consensus.nMaxRemovalWorkaroundHeight = 1000;
consensus.nMinRemovalWorkaroundHeight = -1;
consensus.nMaxRemovalWorkaroundHeight = -1;
consensus.nWitnessForkHeight = 150;
consensus.nAllClaimsInMerkleForkHeight = 350;
consensus.fPowAllowMinDifficultyBlocks = false;

View file

@ -198,7 +198,7 @@ bool CClaimTrieCacheBase::haveSupportInQueue(const std::string& name, const COut
return false;
}
bool emptyNodeShouldExistAt(sqlite::database& db, const std::string& name, int nNextHeight) {
bool emptyNodeShouldExistAt(sqlite::database& db, const std::string& name, int nNextHeight, int requiredChildren) {
auto end = name + std::string(256, std::numeric_limits<char>::max()); // 256 == MAX_CLAIM_NAME_SIZE + 1
auto query = db << "SELECT DISTINCT nodeName FROM claim "
"WHERE nodeName BETWEEN ?1 AND ?2 "
@ -213,7 +213,7 @@ bool emptyNodeShouldExistAt(sqlite::database& db, const std::string& name, int n
return false;
assert(nn.size() > name.size());
ss.insert(nn[name.size()]);
if (ss.size() > 1)
if (ss.size() >= requiredChildren)
return true;
}
return false;
@ -699,7 +699,7 @@ bool CClaimTrieCacheBase::removeClaim(const uint160& claimId, const COutPoint& o
if (nNextHeight >= base->nMinRemovalWorkaroundHeight
&& nNextHeight < base->nMaxRemovalWorkaroundHeight
) {
if (emptyNodeShouldExistAt(db, nodeName, nNextHeight))
if (emptyNodeShouldExistAt(db, nodeName, nNextHeight, 1))
removalWorkaround.insert(nodeName);
}
return true;
@ -857,14 +857,14 @@ int CClaimTrieCacheBase::getDelayForName(const std::string& name, const uint160&
return 0;
}
if (!hasCurrentWinner)
return 0;
if (nNextHeight > base->nMaxRemovalWorkaroundHeight) {
if (!hasCurrentWinner)
return 0;
// TODO: hard fork this out! It's wrong but kept for backwards compatibility
// Plan: if we have no claims for this node but we do have multiple children
// such that we have an implicit node here then return a 0
if (emptyNodeShouldExistAt(db, name, nNextHeight))
if (emptyNodeShouldExistAt(db, name, nNextHeight, 2))
return 0;
}
else {
@ -877,6 +877,9 @@ int CClaimTrieCacheBase::getDelayForName(const std::string& name, const uint160&
}
}
if (!hasCurrentWinner)
return 0;
return std::min((nNextHeight - winningTakeoverHeight) / base->nProportionalDelayFactor, 4032);
}