mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
Remove state arg from ReconsiderBlock
This commit is contained in:
parent
fbd84788e6
commit
addb9d2a09
@ -3011,7 +3011,7 @@ bool InvalidateBlock(CValidationState& state, const CChainParams& chainparams, C
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ReconsiderBlock(CValidationState& state, CBlockIndex *pindex) {
|
||||
bool ReconsiderBlock(CBlockIndex *pindex) {
|
||||
AssertLockHeld(cs_main);
|
||||
|
||||
int nHeight = pindex->nHeight;
|
||||
|
@ -464,7 +464,7 @@ CBlockIndex* FindForkInGlobalIndex(const CChain& chain, const CBlockLocator& loc
|
||||
bool InvalidateBlock(CValidationState& state, const CChainParams& chainparams, CBlockIndex *pindex);
|
||||
|
||||
/** Remove invalidity status from a block and its descendants. */
|
||||
bool ReconsiderBlock(CValidationState& state, CBlockIndex *pindex);
|
||||
bool ReconsiderBlock(CBlockIndex *pindex);
|
||||
|
||||
/** The currently-connected chain of blocks (protected by cs_main). */
|
||||
extern CChain chainActive;
|
||||
|
@ -973,7 +973,6 @@ UniValue reconsiderblock(const UniValue& params, bool fHelp)
|
||||
|
||||
std::string strHash = params[0].get_str();
|
||||
uint256 hash(uint256S(strHash));
|
||||
CValidationState state;
|
||||
|
||||
{
|
||||
LOCK(cs_main);
|
||||
@ -981,12 +980,11 @@ UniValue reconsiderblock(const UniValue& params, bool fHelp)
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found");
|
||||
|
||||
CBlockIndex* pblockindex = mapBlockIndex[hash];
|
||||
ReconsiderBlock(state, pblockindex);
|
||||
ReconsiderBlock(pblockindex);
|
||||
}
|
||||
|
||||
if (state.IsValid()) {
|
||||
ActivateBestChain(state, Params());
|
||||
}
|
||||
CValidationState state;
|
||||
ActivateBestChain(state, Params());
|
||||
|
||||
if (!state.IsValid()) {
|
||||
throw JSONRPCError(RPC_DATABASE_ERROR, state.GetRejectReason());
|
||||
|
Loading…
Reference in New Issue
Block a user