@@ -105,7 +105,6 @@ CAmount maxTxFee = DEFAULT_TRANSACTION_MAXFEE;
105105
106106CBlockPolicyEstimator feeEstimator;
107107CTxMemPool mempool (&feeEstimator);
108- std::map<uint256, int64_t > mapRejectedBlocks GUARDED_BY (cs_main);
109108
110109static void CheckBlockIndex (const Consensus::Params& consensusParams);
111110
@@ -2197,7 +2196,6 @@ static bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockInd
21972196 // The node which relayed this should switch to correct chain.
21982197 // TODO: relay instantsend data/proof.
21992198 LOCK (cs_main);
2200- mapRejectedBlocks.insert (std::make_pair (block.GetHash (), GetTime ()));
22012199 return state.DoS (10 , error (" ConnectBlock(DASH): transaction %s conflicts with transaction lock %s" , tx->GetHash ().ToString (), hashLocked.ToString ()),
22022200 REJECT_INVALID, " conflict-tx-lock" );
22032201 }
@@ -2213,7 +2211,6 @@ static bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockInd
22132211 // The node which relayed this should switch to correct chain.
22142212 // TODO: relay instantsend data/proof.
22152213 LOCK (cs_main);
2216- mapRejectedBlocks.insert (std::make_pair (block.GetHash (), GetTime ()));
22172214 return state.DoS (10 , error (" ConnectBlock(DASH): transaction %s conflicts with transaction lock %s" , tx->GetHash ().ToString (), conflictLock->txid .ToString ()),
22182215 REJECT_INVALID, " conflict-tx-lock" );
22192216 }
@@ -2242,7 +2239,6 @@ static bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockInd
22422239 LogPrint (BCLog::BENCHMARK, " - IsBlockValueValid: %.2fms [%.2fs]\n " , 0.001 * (nTime5_3 - nTime5_2), nTimeValueValid * 0.000001 );
22432240
22442241 if (!IsBlockPayeeValid (*block.vtx [0 ], pindex->nHeight , blockReward)) {
2245- mapRejectedBlocks.insert (std::make_pair (block.GetHash (), GetTime ()));
22462242 return state.DoS (0 , error (" ConnectBlock(DASH): couldn't find masternode or superblock payments" ),
22472243 REJECT_INVALID, " bad-cb-payee" );
22482244 }
@@ -2698,49 +2694,6 @@ bool static ConnectTip(CValidationState& state, const CChainParams& chainparams,
26982694 return true ;
26992695}
27002696
2701- bool DisconnectBlocks (int blocks)
2702- {
2703- LOCK (cs_main);
2704-
2705- CValidationState state;
2706- const CChainParams& chainparams = Params ();
2707-
2708- LogPrintf (" DisconnectBlocks -- Got command to replay %d blocks\n " , blocks);
2709- for (int i = 0 ; i < blocks; i++) {
2710- if (!DisconnectTip (state, chainparams) || !state.IsValid ()) {
2711- return false ;
2712- }
2713- }
2714-
2715- return true ;
2716- }
2717-
2718- void ReprocessBlocks (int nBlocks)
2719- {
2720- LOCK (cs_main);
2721-
2722- std::map<uint256, int64_t >::iterator it = mapRejectedBlocks.begin ();
2723- while (it != mapRejectedBlocks.end ()){
2724- // use a window twice as large as is usual for the nBlocks we want to reset
2725- if ((*it).second > GetTime () - (nBlocks*60 *5 )) {
2726- BlockMap::iterator mi = mapBlockIndex.find ((*it).first );
2727- if (mi != mapBlockIndex.end () && (*mi).second ) {
2728-
2729- CBlockIndex* pindex = (*mi).second ;
2730- LogPrintf (" ReprocessBlocks -- %s\n " , (*it).first .ToString ());
2731-
2732- ResetBlockFailureFlags (pindex);
2733- }
2734- }
2735- ++it;
2736- }
2737-
2738- DisconnectBlocks (nBlocks);
2739-
2740- CValidationState state;
2741- ActivateBestChain (state, Params ());
2742- }
2743-
27442697/* *
27452698 * Return the tip of the chain with the most work in it, that isn't
27462699 * known to be invalid (it's however far from certain to be valid).
0 commit comments