transaction: Adding script witness to ToString for CTxIn #33711

pull Ataraxia009 wants to merge 1 commits into bitcoin:master from Ataraxia009:core-txIn-toString-enhancement changing 1 files +3 −1
  1. Ataraxia009 commented at 5:19 am on October 27, 2025: none
    When debugging and trying to print the details of a CTxIn using the ToString, we get the scriptSig, but would also help to get the witness.
  2. transaction: Adding script witness to ToString for CTxIn 61cd0e53ca
  3. DrahtBot commented at 5:19 am on October 27, 2025: contributor

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

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33711.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept ACK optout21

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

  4. optout21 commented at 5:42 am on November 1, 2025: none

    Concept ACK 61cd0e53ca45684cd5ef9084829ecc6d59154595

    I notice that CTransaction::ToString() prints the inputs and the input script witnesses additionally, with that change script witnesses will be included duplicated. The order there is first all inputs, then all witnesses. Please consider removing the duplication. Options:

    • keep the duplication
    • remove duplication, change the order
    • remove the duplication and keep the order – there should be a version of CTxIn::ToString() without witness?

    https://github.com/bitcoin/bitcoin/blob/master/src/primitives/transaction.cpp#L126

    0    for (const auto& tx_in : vin)
    1        str += "    " + tx_in.ToString() + "\n";
    2    for (const auto& tx_in : vin)
    3        str += "    " + tx_in.scriptWitness.ToString() + "\n";
    

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: 2025-11-02 18:12 UTC

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