| 1772 | } |
| 1773 | |
| 1774 | void ReconsiderBlock(ChainstateManager& chainman, uint256 block_hash) { |
| 1775 | { |
| 1776 | LOCK(chainman.GetMutex()); |
| 1777 | CBlockIndex* pblockindex = chainman.m_blockman.LookupBlockIndex(block_hash); |
| 1778 | if (!pblockindex) { |
| 1779 | throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found"); |
| 1780 | } |
| 1781 | |
| 1782 | chainman.ActiveChainstate().ResetBlockFailureFlags(pblockindex); |
| 1783 | chainman.RecalculateBestHeader(); |
| 1784 | } |
| 1785 | |
| 1786 | BlockValidationState state; |
| 1787 | chainman.ActiveChainstate().ActivateBestChain(state); |
| 1788 | |
| 1789 | if (!state.IsValid()) { |
| 1790 | throw JSONRPCError(RPC_DATABASE_ERROR, state.ToString()); |
| 1791 | } |
| 1792 | } |
| 1793 | |
| 1794 | static RPCMethod reconsiderblock() |
| 1795 | { |
no test coverage detected