diff options
| author | Pieter Wuille <[email protected]> | 2019-02-13 15:53:24 -0800 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2019-02-24 18:55:21 -0800 |
| commit | 9b1ff5c742dec0a6e0d6aab29b0bb771ad6d8135 (patch) | |
| tree | 6b3d329b0b99b1219a487d083fdd076b9725e217 /src/rpc/blockchain.cpp | |
| parent | Make RewindBlockIndex interruptible (diff) | |
| download | discoin-9b1ff5c742dec0a6e0d6aab29b0bb771ad6d8135.tar.xz discoin-9b1ff5c742dec0a6e0d6aab29b0bb771ad6d8135.zip | |
Call InvalidateBlock without cs_main held
Diffstat (limited to 'src/rpc/blockchain.cpp')
| -rw-r--r-- | src/rpc/blockchain.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 7fb9ff2ea..1169446ef 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1583,15 +1583,15 @@ static UniValue invalidateblock(const JSONRPCRequest& request) uint256 hash(ParseHashV(request.params[0], "blockhash")); CValidationState state; + CBlockIndex* pblockindex; { LOCK(cs_main); - CBlockIndex* pblockindex = LookupBlockIndex(hash); + pblockindex = LookupBlockIndex(hash); if (!pblockindex) { throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found"); } - - InvalidateBlock(state, Params(), pblockindex); } + InvalidateBlock(state, Params(), pblockindex); if (state.IsValid()) { ActivateBestChain(state, Params()); |