Drop no longer used code and bump min protos (#2697)

* Drop registry deletion of the old key

* Drop no longer used CGovernanceObjectVoteFile::RemoveOldVotes()

* Drop temporary disconnect code and bump min protos to 70213

* drop comment

* fix
This commit is contained in:
UdjinM6 2019-02-12 22:51:21 +03:00 committed by GitHub
parent fef8e5d45f
commit 86fc050495
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 7 additions and 64 deletions

View File

@ -10,7 +10,7 @@ NSEEDS=512
MAX_SEEDS_PER_ASN=4
MIN_PROTOCOL_VERSION = 70210
MIN_PROTOCOL_VERSION = 70213
MAX_LAST_SEEN_DIFF = 60 * 60 * 24 * 1 # 1 day
MAX_LAST_PAID_DIFF = 60 * 60 * 24 * 30 # 1 month

View File

@ -39,7 +39,7 @@ from test_framework.siphash import siphash256
import dash_hash
BIP0031_VERSION = 60000
MY_VERSION = 70210 # MIN_PEER_PROTO_VERSION
MY_VERSION = 70213 # MIN_PEER_PROTO_VERSION
MY_SUBVERSION = b"/python-mininode-tester:0.0.3/"
MY_RELAY = 1 # from version 70001 onwards, fRelay should be appended to version messages (BIP37)

View File

@ -107,10 +107,6 @@ Section -post SEC0001
WriteRegStr HKCR "@PACKAGE_TARNAME@" "" "URL:Dash"
WriteRegStr HKCR "@PACKAGE_TARNAME@\DefaultIcon" "" $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@
WriteRegStr HKCR "@PACKAGE_TARNAME@\shell\open\command" "" '"$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" "%1"'
# Delete old key (before we switched to PACKAGE_TARNAME, which is set to 'dashcore' now, we had 'dash' hardcoded)
# TODO remove this line sometime later
DeleteRegKey HKCR "dash"
SectionEnd
# Macro for selecting uninstaller sections
@ -150,9 +146,6 @@ Section -un.post UNSEC0001
DeleteRegKey /IfEmpty HKCU "${REGKEY}\Components"
DeleteRegKey /IfEmpty HKCU "${REGKEY}"
DeleteRegKey HKCR "@PACKAGE_TARNAME@"
# Delete old key (before we switched to PACKAGE_TARNAME, which is set to 'dashcore' now, we had 'dash' hardcoded)
# TODO remove this line sometime later
DeleteRegKey HKCR "dash"
RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup
RmDir /REBOOTOK $INSTDIR
Push $R0

View File

@ -372,9 +372,6 @@ UniValue CGovernanceObject::GetJSONObject()
void CGovernanceObject::LoadData()
{
// todo : 12.1 - resolved
//return;
if (vchData.empty()) {
return;
}

View File

@ -25,7 +25,7 @@ class CGovernanceTriggerManager;
class CGovernanceObject;
class CGovernanceVote;
static const int MIN_GOVERNANCE_PEER_PROTO_VERSION = 70210;
static const int MIN_GOVERNANCE_PEER_PROTO_VERSION = 70213;
static const int GOVERNANCE_FILTER_PROTO_VERSION = 70206;
static const double GOVERNANCE_FILTER_FP_RATE = 0.001;

View File

@ -89,23 +89,6 @@ std::set<uint256> CGovernanceObjectVoteFile::RemoveInvalidProposalVotes(const CO
return removedVotes;
}
std::vector<uint256> CGovernanceObjectVoteFile::RemoveOldVotes(unsigned int nMinTime)
{
std::vector<uint256> removed;
vote_l_it it = listVotes.begin();
while (it != listVotes.end()) {
if (it->GetTimestamp() < nMinTime) {
--nMemoryVotes;
removed.emplace_back(it->GetHash());
mapVoteIndex.erase(it->GetHash());
listVotes.erase(it++);
} else {
++it;
}
}
return removed;
}
void CGovernanceObjectVoteFile::RebuildIndex()
{
mapVoteIndex.clear();

View File

@ -75,9 +75,6 @@ public:
void RemoveVotesFromMasternode(const COutPoint& outpointMasternode);
std::set<uint256> RemoveInvalidProposalVotes(const COutPoint& outpointMasternode);
// TODO can be removed after full DIP3 deployment
std::vector<uint256> RemoveOldVotes(unsigned int nMinTime);
ADD_SERIALIZE_METHODS;
template <typename Stream, typename Operation>

View File

@ -28,7 +28,7 @@ extern CInstantSend instantsend;
(1000/2900.0)**5 = 0.004875397277841433
*/
static const int MIN_INSTANTSEND_PROTO_VERSION = 70210;
static const int MIN_INSTANTSEND_PROTO_VERSION = 70213;
/// For how long we are going to accept votes/locks
/// after we saw the first one for a specific transaction

View File

@ -1348,19 +1348,6 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
return true;
}
// BEGIN TEMPORARY CODE
bool fDIP0003Active;
{
LOCK(cs_main);
fDIP0003Active = VersionBitsState(chainActive.Tip(), chainparams.GetConsensus(), Consensus::DEPLOYMENT_DIP0003, versionbitscache) == THRESHOLD_ACTIVE;
}
// TODO delete this in next release after v13
int nMinPeerProtoVersion = MIN_PEER_PROTO_VERSION;
if (fDIP0003Active) {
nMinPeerProtoVersion = MIN_PEER_PROTO_VERSION_DIP3;
}
// END TEMPORARY CODE
if (!(pfrom->GetLocalServices() & NODE_BLOOM) &&
(strCommand == NetMsgType::FILTERLOAD ||
strCommand == NetMsgType::FILTERADD))
@ -1448,12 +1435,12 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
return false;
}
if (nVersion < nMinPeerProtoVersion)
if (nVersion < MIN_PEER_PROTO_VERSION)
{
// disconnect from peers older than this proto version
LogPrintf("peer=%d using obsolete version %i; disconnecting\n", pfrom->id, nVersion);
connman.PushMessage(pfrom, CNetMsgMaker(INIT_PROTO_VERSION).Make(NetMsgType::REJECT, strCommand, REJECT_OBSOLETE,
strprintf("Version must be %d or greater", nMinPeerProtoVersion)));
strprintf("Version must be %d or greater", MIN_PEER_PROTO_VERSION)));
pfrom->fDisconnect = true;
return false;
}
@ -1594,17 +1581,6 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
// At this point, the outgoing message serialization version can't change.
const CNetMsgMaker msgMaker(pfrom->GetSendVersion());
// BEGIN TEMPORARY CODE
if (pfrom->nVersion < nMinPeerProtoVersion) {
// disconnect from peers with version < 70213 after DIP3 has activated through the BIP9 deployment
LogPrintf("peer=%d using obsolete version %i after DIP3 activation; disconnecting\n", pfrom->id, pfrom->GetSendVersion());
connman.PushMessage(pfrom, msgMaker.Make(NetMsgType::REJECT, strCommand, REJECT_OBSOLETE,
strprintf("Version must be %d or greater", nMinPeerProtoVersion)));
pfrom->fDisconnect = true;
return false;
}
// END TEMPORARY CODE
if (strCommand == NetMsgType::VERACK)
{
pfrom->SetRecvVersion(std::min(pfrom->nVersion.load(), PROTOCOL_VERSION));

View File

@ -20,10 +20,7 @@ static const int INIT_PROTO_VERSION = 209;
static const int GETHEADERS_VERSION = 70077;
//! disconnect from peers older than this proto version
static const int MIN_PEER_PROTO_VERSION = 70210;
//! disconnect from peers older than this proto version when DIP3 is activated via the BIP9 deployment
static const int MIN_PEER_PROTO_VERSION_DIP3 = 70213;
static const int MIN_PEER_PROTO_VERSION = 70213;
//! nTime field added to CAddress, starting with this version;
//! if possible, avoid requesting addresses nodes older than this