Skip to content

Commit 2247c06

Browse files
author
limxdev
committed
Second step to remove Watchdog functions
1 parent a19eb17 commit 2247c06

10 files changed

Lines changed: 20 additions & 40 deletions

File tree

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ AC_PREREQ([2.60])
33
define(_CLIENT_VERSION_MAJOR, 0)
44
define(_CLIENT_VERSION_MINOR, 90)
55
define(_CLIENT_VERSION_REVISION, 8)
6-
define(_CLIENT_VERSION_BUILD, 10)
6+
define(_CLIENT_VERSION_BUILD, 11)
77
define(_CLIENT_VERSION_IS_RELEASE, true)
88
define(_COPYRIGHT_YEAR, 2020)
99
define(_COPYRIGHT_HOLDERS,[The %s developers])

src/chainparams.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,9 @@ class CMainParams : public CChainParams {
215215
{ 200000, uint256S("0x65c89c662dbdad4aeeb4215076884be736a7512984741b353bbdef47478305e5")},
216216
{ 215000, uint256S("0x18accc496518e6f3008eeaab7e04123939d66eb7f8a02f2fcb3d69093c1df38c")},
217217
{ 356548, uint256S("0xf62b6c5645997d078d9cb130cfe96d64ec2c047bbceca3ae8ffc373eef80b866")},
218+
{ 550000, uint256S("0xa901848fe9d22814dbb3e0f62892d3bd7a1e70f6a48a459e68ebaf24ea5d5867")},
218219
}
219220
};
220-
// FXTC BEGIN
221-
consensus.nlastValidPowHashHeight = 999999999;
222-
// FXTC
223221

224222
chainTxData = ChainTxData{
225223
// BTX: data as of block 0x8da1c7f79018fac8acac69a57b2f8b5d2743af67976a4525fdedc8c85a3a1418 (height 410476).
@@ -364,9 +362,7 @@ class CTestNetParams : public CChainParams {
364362
{0, uint256S("0xe02c5d66e8edb49984eb743c798bca069466ce457b7febfa3c3a01b33353b7bc6")},
365363
}
366364
};
367-
// FXTC BEGIN
368-
consensus.nlastValidPowHashHeight = 99999999;;
369-
// FXTC
365+
370366

371367
chainTxData = ChainTxData{
372368
// BTX: data as of block 0x8da1c7f79018fac8acac69a57b2f8b5d2743af67976a4525fdedc8c85a3a1418 (height 410476).
@@ -482,9 +478,7 @@ class CRegTestParams : public CChainParams {
482478
{0, uint256S("0x604148281e5c4b7f2487e5d03cd60d8e6f69411d613f6448034508cea52e9574")},
483479
}
484480
};
485-
// FXTC BEGIN
486-
consensus.nlastValidPowHashHeight = 99999999;;
487-
// FXTC
481+
488482

489483
chainTxData = ChainTxData{
490484
0,

src/consensus/params.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,6 @@ struct Params {
115115
int64_t DifficultyAdjustmentIntervalV2() const { return nPowTargetTimespanV2 / nPowTargetSpacing; }
116116
uint256 nMinimumChainWork;
117117
uint256 defaultAssumeValid;
118-
// FXTC BEGIN
119-
int nlastValidPowHashHeight;
120-
// FXTC EMD
121118
};
122119
} // namespace Consensus
123120

src/masternode-payments.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ bool IsBlockPayeeValid(const CTransactionRef txNew, int nBlockHeight, CAmount bl
143143
// we can only check masternode payments
144144

145145
const Consensus::Params& consensusParams = Params().GetConsensus();
146-
146+
//We should leave that here until we start the Superblocksystem. The second stage is the Spork 8 only if Superblock are online - Chris 2020
147147
if(sporkManager.IsSporkActive(SPORK_22_MASTERNODE_PAYMENT_ENFORCEMENT))
148148
{
149149
LogPrintf("IsBlockPayeeValid SPORK_22 -- ERROR: Invalid masternode payment detected at height %d: %s\n", nBlockHeight, txNew->ToString());

src/masternode.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ class CMasternodePing
5353
READWRITE(blockHash);
5454
READWRITE(sigTime);
5555
READWRITE(vchSig);
56-
if(ser_action.ForRead() && (s.size() == 0))
57-
{
58-
fSentinelIsCurrent = false;
59-
nSentinelVersion = DEFAULT_SENTINEL_VERSION;
60-
return;
61-
}
62-
READWRITE(fSentinelIsCurrent);
63-
READWRITE(nSentinelVersion);
56+
//if(ser_action.ForRead() && (s.size() == 0))
57+
//{
58+
// fSentinelIsCurrent = false;
59+
// nSentinelVersion = DEFAULT_SENTINEL_VERSION;
60+
// return;
61+
//}
62+
//READWRITE(fSentinelIsCurrent);
63+
//READWRITE(nSentinelVersion);
6464
}
6565

6666
uint256 GetHash() const

src/masternodeman.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ void CMasternodeMan::Check()
156156
LOCK2(cs_main, cs);
157157
// FXTC END
158158

159-
LogPrint(BCLog::MASTERNODE, "CMasternodeMan::Check -- nLastWatchdogVoteTime=%d, IsWatchdogActive()=%d\n", nLastWatchdogVoteTime, IsWatchdogActive());
159+
//LogPrint(BCLog::MASTERNODE, "CMasternodeMan::Check -- nLastWatchdogVoteTime=%d, IsWatchdogActive()=%d\n", nLastWatchdogVoteTime, IsWatchdogActive());
160160

161161
for (auto& mnpair : mapMasternodes) {
162162
mnpair.second.Check();
@@ -802,8 +802,8 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, const std::string& strCommand,
802802
// if masternode uses sentinel ping instead of watchdog
803803
// we shoud update nTimeLastWatchdogVote here if sentinel
804804
// ping flag is actual
805-
if(pmn && mnp.fSentinelIsCurrent)
806-
UpdateWatchdogVoteTime(mnp.vin.prevout, mnp.sigTime);
805+
//if(pmn && mnp.fSentinelIsCurrent)
806+
// UpdateWatchdogVoteTime(mnp.vin.prevout, mnp.sigTime);
807807

808808
// too late, new MNANNOUNCE is required
809809
if(pmn && pmn->IsNewStartRequired()) return;
@@ -1495,12 +1495,6 @@ void CMasternodeMan::UpdateWatchdogVoteTime(const COutPoint& outpoint, uint64_t
14951495
nLastWatchdogVoteTime = GetTime();
14961496
}
14971497

1498-
bool CMasternodeMan::IsWatchdogActive()
1499-
{
1500-
LOCK(cs);
1501-
// Check if any masternodes have voted recently, otherwise return false
1502-
return (GetTime() - nLastWatchdogVoteTime) <= MASTERNODE_WATCHDOG_MAX_SECONDS;
1503-
}
15041498

15051499
bool CMasternodeMan::AddGovernanceVote(const COutPoint& outpoint, uint256 nGovernanceObjectHash)
15061500
{
@@ -1553,9 +1547,9 @@ void CMasternodeMan::SetMasternodeLastPing(const COutPoint& outpoint, const CMas
15531547
// if masternode uses sentinel ping instead of watchdog
15541548
// we shoud update nTimeLastWatchdogVote here if sentinel
15551549
// ping flag is actual
1556-
if(mnp.fSentinelIsCurrent) {
1557-
UpdateWatchdogVoteTime(mnp.vin.prevout, mnp.sigTime);
1558-
}
1550+
//if(mnp.fSentinelIsCurrent) {
1551+
// UpdateWatchdogVoteTime(mnp.vin.prevout, mnp.sigTime);
1552+
//}
15591553
mapSeenMasternodePing.insert(std::make_pair(mnp.GetHash(), mnp));
15601554

15611555
CMasternodeBroadcast mnb(*pmn);

src/masternodeman.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ class CMasternodeMan
218218
return vecTmp;;
219219
}
220220

221-
bool IsWatchdogActive();
222221
void UpdateWatchdogVoteTime(const COutPoint& outpoint, uint64_t nVoteTime = 0);
223222
bool AddGovernanceVote(const COutPoint& outpoint, uint256 nGovernanceObjectHash);
224223
void RemoveGovernanceObject(uint256 nGovernanceObjectHash);

src/rpc/masternode.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,6 @@ UniValue masternodelist(const JSONRPCRequest& request)
582582
(int64_t)mn.lastPing.sigTime << " " << std::setw(8) <<
583583
(int64_t)(mn.lastPing.sigTime - mn.sigTime) << " " <<
584584
SafeIntVersionToString(mn.lastPing.nSentinelVersion) << " " <<
585-
(mn.lastPing.fSentinelIsCurrent ? "current" : "expired") << " " <<
586585
mn.addr.ToString();
587586
std::string strInfo = streamInfo.str();
588587
if (strFilter !="" && strInfo.find(strFilter) == std::string::npos &&

src/txdb.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,6 @@ bool CBlockTreeDB::LoadBlockIndexGuts(const Consensus::Params& consensusParams,
274274
pindexNew->nStatus = diskindex.nStatus;
275275
pindexNew->nTx = diskindex.nTx;
276276

277-
// BitCore BEGIN
278-
if (pindexNew->nHeight > consensusParams.nlastValidPowHashHeight)
279-
// FXTC END
280277
if (!CheckProofOfWork(pindexNew->GetBlockPoWHash(), pindexNew->nBits, consensusParams))
281278
return error("%s: CheckProofOfWork failed: %s", __func__, pindexNew->ToString());
282279

src/validation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3660,7 +3660,7 @@ bool CChainState::AcceptBlockHeader(const CBlockHeader& block, CValidationState&
36603660
if (pindexPrev->nStatus & BLOCK_FAILED_MASK)
36613661
return state.DoS(100, error("%s: prev block invalid", __func__), REJECT_INVALID, "bad-prevblk");
36623662
// FXTC BEGIN
3663-
if (fCheckpointsEnabled && pindexPrev->nHeight < chainparams.GetConsensus().nlastValidPowHashHeight && !Checkpoints::IsExpectedCheckpoint(chainparams.Checkpoints(), pindexPrev->nHeight + 1, block.GetHash()))
3663+
if (fCheckpointsEnabled && !Checkpoints::IsExpectedCheckpoint(chainparams.Checkpoints(), pindexPrev->nHeight + 1, block.GetHash()))
36643664
return state.DoS(100, error("%s: Checkpoints::IsExpectedCheckpoint(): invalid checkpoint at height %d", __func__, pindexPrev->nHeight + 1), REJECT_CHECKPOINT, "bad-chackpoint");
36653665
// FXTC END
36663666
if (!ContextualCheckBlockHeader(block, state, chainparams, pindexPrev, GetAdjustedTime()))

0 commit comments

Comments
 (0)