diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-05-10 12:43:19 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-05-10 12:43:22 +0200 |
commit | f7a21dae5dbf71d5bc00485215e84e6f2b309d0a (patch) | |
tree | 680a7f6957c4e38ac154cebda6e41c7f0fc4dd55 | |
parent | 5767e80dda7a699597b4798d1546e618edb50928 (diff) | |
parent | 657e07efa34ffe9d8614a618e00452c9ee7c0e0d (diff) |
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)
-rw-r--r-- | src/main.cpp | 2 | ||||
-rw-r--r-- | src/main.h | 2 | ||||
-rw-r--r-- | src/rpc/blockchain.cpp | 8 |
3 files changed, 5 insertions, 7 deletions
diff --git a/src/main.cpp b/src/main.cpp index ebe91f7fa9..ee30954b48 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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; diff --git a/src/main.h b/src/main.h index 3cc16fd8f4..548218a1b5 100644 --- a/src/main.h +++ b/src/main.h @@ -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; diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 6960415e2e..cf3c73c4df 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -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); + ResetBlockFailureFlags(pblockindex); } - if (state.IsValid()) { - ActivateBestChain(state, Params()); - } + CValidationState state; + ActivateBestChain(state, Params()); if (!state.IsValid()) { throw JSONRPCError(RPC_DATABASE_ERROR, state.GetRejectReason()); |