utxoupdatepsbt is not querying the utxoset? #23205

issue NicolasDorier opened this issue on October 6, 2021
  1. NicolasDorier commented at 10:48 AM on October 6, 2021: contributor

    Version: 22.0

    I am trying to check if the input 0647b5d109a17cec1a8ef0daaba1a2fa7c149be90378dc6558a69bfd7a5a3c61:7 exists in the utxo set.

    So I ran

    bitcoin-cli utxoupdatepsbt "cHNidP8BAFIBAAAAAWE8Wnr9m6ZYZdx4A+mbFHz6oqGr2vCOGux8oQnRtUcGBwAAAAD/////AQDh9QUAAAAAFgAU2p9ek8b0XqED4coMbbrJsdkrWzEAAAAAAAAA"
    

    But the returned PSBT show me that witness_utxo is not set. I would expect it to be filled.

    How can I query the utxoset to know if an utxo has been spent?

  2. NicolasDorier added the label Bug on Oct 6, 2021
  3. achow101 commented at 3:24 PM on October 6, 2021: member

    You can use gettxout to check if a utxo is in the utxo set.

    The reason this is not working is because utxoupdatepsbt only works for segwit outputs. The output in question is a P2SH output, so it is not being added to the psbt. If you provide a descriptor that corresponds to this output, and that descriptor indicates it is actually a p2sh-segwit output, then it will be added to the psbt.

  4. NicolasDorier closed this on Oct 7, 2021

  5. NicolasDorier commented at 7:58 AM on October 7, 2021: contributor

    It makes sense. I wished that it made an attempt to get the witness_utxo, even without being segwit, but gettxout might solve my problem.

  6. DrahtBot locked this on Oct 30, 2022
Labels

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-24 15:14 UTC

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