refactor: rpc: set TxToJSON default verbosity to SHOW_DETAILS #26974

pull stickies-v wants to merge 1 commits into bitcoin:master from stickies-v:txtojson-default-verbosity-details changing 2 files +6 −1
  1. stickies-v commented at 11:36 AM on January 26, 2023: contributor

    TxToJSON() and TxToUniv() are only to be called when we want to decode the transaction (i.e. its details) into JSON. If TxVerbosity is SHOW_TXID, the function should not have been (and currently is not) called in the first place.

    There is no behaviour change, current logic simply assumes anything less than TxVerbosity::SHOW_DETAILS_AND_PREVOUT equals TxVerbosity::SHOW_DETAILS. With this change, the assumptions and intent become more explicit.

  2. DrahtBot commented at 11:36 AM on January 26, 2023: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK w0xlt

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  3. DrahtBot added the label Refactoring on Jan 26, 2023
  4. fanquake commented at 11:49 AM on January 26, 2023: member
    CHECK_NONFATAL(condition) or NONFATAL_UNREACHABLE should be used instead of assert for RPC code.
    src/rpc/rawtransaction.cpp:61:    assert(verbosity >= TxVerbosity::SHOW_DETAILS);
    
  5. refactor: rpc: set TxToJSON default verbosity to SHOW_DETAILS
    `TxToJSON()` and `TxToUniv()` are only to be called when we want to
    decode the transaction (i.e. its details) into JSON. If `TxVerbosity` is
    `SHOW_TXID`, the function should not have been (and currently is not)
    called in the first place.
    
    There is no behaviour change, current logic simply assumes anything less
    than `TxVerbosity::SHOW_DETAILS_AND_PREVOUT` equals
    `TxVerbosity::SHOW_DETAILS`. With this change, the assumptions and
    intent become more explicit.
    a24e633339
  6. stickies-v force-pushed on Jan 26, 2023
  7. w0xlt approved
  8. maflcko merged this on Jan 31, 2023
  9. maflcko closed this on Jan 31, 2023

  10. sidhujag referenced this in commit bd2d3e14ec on Feb 1, 2023
  11. stickies-v deleted the branch on Mar 14, 2023
  12. bitcoin locked this on Mar 13, 2024

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-19 03:13 UTC

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