bitcoin-tx: fix comment about pay-to-witness script type ("addoutpubkey" command) #16833

pull theStack wants to merge 2 commits into bitcoin:master from theStack:20190908-bitcoin-tx_fix_comment_p2wsh_to_p2wpkh changing 1 files +2 −2
  1. theStack commented at 7:22 PM on September 8, 2019: member

    The function GetScriptForWitness() returns a P2WPKH script if the passed redeem script is P2PK or P2PKH, otherwise it returns a P2WSH. Since we pass a P2PK script here (constructed a few lines above through GetScriptForRawPubKey()) the result is rather P2WPKH than P2WSH and the comment is adapted accordingly.

  2. bitcoin-tx: fix comment about pay-to-witness script type ("addoutpubkey" command)
    The function GetScriptForWitness() returns a P2WPKH script if the
    passed redeem script is P2PK or P2PKH, otherwise it returns a P2WSH.
    Since we pass a P2PK script here (constructed a few lines above
    through GetScriptForRawPubKey()) the result is rather P2WPKH than
    P2WSH and the comment is adapted accordingly.
    f542215156
  3. fanquake added the label Docs on Sep 8, 2019
  4. fanquake requested review from meshcollider on Sep 8, 2019
  5. meshcollider commented at 11:09 AM on September 9, 2019: contributor

    ACK f542215156022dcc17fd067a9fa53afff4b900fd

    Looks like it was incorrectly duplicated from the multisig version of the function below it.

  6. instagibbs commented at 1:05 PM on September 9, 2019: member

    honestly I think the whole comment is pretty redundant? I'd be more inclined to just delete it

  7. bitcoin-tx: shortened comments about pay-to-witness script types ("addoutpubkey" command) 2a965dbd87
  8. theStack commented at 3:13 PM on September 9, 2019: member

    honestly I think the whole comment is pretty redundant? I'd be more inclined to just delete it

    I agree that it mostly describes what can be seen in the code anyway (name of the function being called, name of the variable the result is being assigned to), the only informational part is the resulting script type. Shortened the comments it for both the pubkey (-> P2WPKH) and the multisig (-> P2WSH) comments before the according function call in 2a965db.

  9. instagibbs commented at 9:11 PM on September 9, 2019: member
  10. DrahtBot commented at 2:31 AM on September 10, 2019: member

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #16841 (Replace GetScriptForWitness with GetScriptForDestination by meshcollider)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  11. meshcollider commented at 2:38 AM on September 10, 2019: contributor

    #16841 improves these comments

  12. fanquake commented at 5:25 AM on September 11, 2019: member

    Going to close this in favor of #16841, which also improves these comments. @theStack Thanks for the contribution, did you want to review over there? @instagibbs too.

  13. fanquake closed this on Sep 11, 2019

  14. DrahtBot locked this on Dec 16, 2021

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-14 21:14 UTC

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