rpc: Return whether the block was invalidated on invalidateblock #15494

pull promag wants to merge 2 commits into bitcoin:master from promag:2019-02-invalidateblock changing 2 files +8 −2
  1. promag commented at 12:32 PM on February 27, 2019: member

    This PR adds a return value to the RPC invalidateblock. For now the the return object has the key invalidated.

  2. fanquake added the label RPC/REST/ZMQ on Feb 27, 2019
  3. DrahtBot commented at 2:11 PM on February 27, 2019: member

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    No conflicts as of last run.

  4. in src/validation.cpp:2806 in a2195cf8f7 outdated
    2832 | -    }
    2833 | +        DisconnectedBlockTransactions disconnectpool;
    2834 | +        bool ret = DisconnectTip(state, chainparams, &disconnectpool);
    2835 | +        // DisconnectTip will add transactions to disconnectpool.
    2836 | +        // Adjust the mempool to be consistent with the new tip, adding
    2837 | +        // transactions back to the mempool if disconnecting was succesful,
    


    practicalswift commented at 8:23 PM on February 28, 2019:

    Should be "successful"? :-)

  5. DrahtBot added the label Needs rebase on Mar 7, 2019
  6. rpc: Return whether the block was invalidated on invalidateblock 4bd3caeaa4
  7. qa: Test invalidateblock result d5dd80c3e9
  8. promag force-pushed on Mar 8, 2019
  9. promag commented at 3:43 PM on March 8, 2019: member

    Rebased.

  10. DrahtBot removed the label Needs rebase on Mar 8, 2019
  11. in src/rpc/blockchain.cpp:1603 in d5dd80c3e9
    1596 | @@ -1597,7 +1597,12 @@ static UniValue invalidateblock(const JSONRPCRequest& request)
    1597 |          throw JSONRPCError(RPC_DATABASE_ERROR, FormatStateMessage(state));
    1598 |      }
    1599 |  
    1600 | -    return NullUniValue;
    1601 | +    UniValue res(UniValue::VOBJ);
    1602 | +    {
    1603 | +        LOCK(cs_main);
    1604 | +        res.pushKV("invalidated", !chainActive.Contains(pblockindex));
    


    laanwj commented at 3:00 PM on June 6, 2019:

    Need to be documented in the RPC help. Please also mention in what cases it can happen that the block was not invalidated but it does get all the way to the end here.


    promag commented at 3:22 PM on October 10, 2019:
  12. DrahtBot closed this on Mar 9, 2020

  13. DrahtBot commented at 8:34 PM on March 9, 2020: member

    <!--5d09a71f8925f3f132321140b44b946d-->The last travis run for this pull request was 364 days ago and is thus outdated. To trigger a fresh travis build, this pull request should be closed and re-opened.

  14. DrahtBot reopened this on Mar 9, 2020

  15. promag closed this on Apr 27, 2020

  16. promag deleted the branch on Apr 27, 2020
  17. DrahtBot locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me