Browse Source

Merge #8019: Remove state arg from ReconsiderBlock, rename to ResetBlockFailureFlags

657e07e Rename ReconsiderBlock func to reflect real behavior (instagibbs)
addb9d2 Remove state arg from ReconsiderBlock (instagibbs)
0.13
Wladimir J. van der Laan 9 years ago
parent
commit
f7a21dae5d
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 2
      src/main.cpp
  2. 2
      src/main.h
  3. 6
      src/rpc/blockchain.cpp

2
src/main.cpp

@ -3008,7 +3008,7 @@ bool InvalidateBlock(CValidationState& state, const CChainParams& chainparams, C @@ -3008,7 +3008,7 @@ bool InvalidateBlock(CValidationState& state, const CChainParams& chainparams, C
return true;
}
bool ReconsiderBlock(CValidationState& state, CBlockIndex *pindex) {
bool ResetBlockFailureFlags(CBlockIndex *pindex) {
AssertLockHeld(cs_main);
int nHeight = pindex->nHeight;

2
src/main.h

@ -464,7 +464,7 @@ CBlockIndex* FindForkInGlobalIndex(const CChain& chain, const CBlockLocator& loc @@ -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 ResetBlockFailureFlags(CBlockIndex *pindex);
/** The currently-connected chain of blocks (protected by cs_main). */
extern CChain chainActive;

6
src/rpc/blockchain.cpp

@ -973,7 +973,6 @@ UniValue reconsiderblock(const UniValue& params, bool fHelp) @@ -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) @@ -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);
ResetBlockFailureFlags(pblockindex);
}
if (state.IsValid()) {
CValidationState state;
ActivateBestChain(state, Params());
}
if (!state.IsValid()) {
throw JSONRPCError(RPC_DATABASE_ERROR, state.GetRejectReason());

Loading…
Cancel
Save