psbt: AnalyzePSBT set next to"finalizer" when all inputs need finalizing #18220

pull Sjors wants to merge 1 commits into bitcoin:master from Sjors:2020/02/analyze_psbt changing 2 files +11 −6
  1. Sjors commented at 10:31 am on February 28, 2020: member

    A PSBT signed by ColdCard was analyzed as follows (see #17509 (review))

     0{
     1  "inputs": [
     2    {
     3      "has_utxo": true,
     4      "is_final": false,
     5      "next": "finalizer"
     6    }
     7  ],
     8  "estimated_vsize": 141,
     9  "estimated_feerate": 1e-05,
    10  "fee": 1.41e-06,
    11  "next": "signer"
    12}
    

    I changed AnalyzePSBT so that it returns "next": "finalizer" instead.

  2. fanquake added the label PSBT on Feb 28, 2020
  3. Sjors renamed this:
    psbt: AnalyzePSBT set next to FINALIZER when all inputs need finalizing
    psbt: AnalyzePSBT set next to"finalizer" when all inputs need finalizing
    on Feb 28, 2020
  4. instagibbs commented at 3:16 pm on February 28, 2020: member
    Can you explain the code path master is hitting? Mind sharing the PSBT? :)
  5. Sjors commented at 3:23 pm on February 28, 2020: member

    Just try with a ColdCard simulator, it’s pretty reproducible. On master result.next is set to SIGNER because only_missing_sigs is checked before only_missing_final. The latter is set to true along with the input being marked as FINALIZER.

    The reason master doesn’t check only_missing_final first is that it starts as false and can be toggled to true for any input. So I reversed that to starting true and being toggled to false if any input is not final.

  6. instagibbs commented at 3:31 pm on February 28, 2020: member
    If it’s really easy to set up I think a checked in test is in order
  7. [psbt] AnalyzePSBT: set next to FINALIZER when all inputs need finalizing
    Previously the next step would be SIGNER if all of the inputs had FINALIZER as their next step.
    64a44dc25c
  8. Sjors force-pushed on Feb 28, 2020
  9. Sjors commented at 3:57 pm on February 28, 2020: member
    I added a test.
  10. instagibbs commented at 4:28 pm on February 28, 2020: member
    I had such trouble understanding the function I decided a proper refactor of logic was in order: https://github.com/bitcoin/bitcoin/pull/18224
  11. Sjors closed this on Feb 28, 2020

  12. meshcollider referenced this in commit 1f886243e4 on Mar 2, 2020
  13. sidhujag referenced this in commit 24a43a9ab0 on Mar 2, 2020
  14. sidhujag referenced this in commit eaf7646859 on Nov 10, 2020
  15. DrahtBot locked this on Feb 15, 2022


Sjors instagibbs

Labels
PSBT


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: 2024-12-03 15:12 UTC

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