rpc: add missing scantxoutset examples #23634

pull theStack wants to merge 1 commits into bitcoin:master from theStack:202111-rpc-add_scantxoutset_examples changing 1 files +11 −1
  1. theStack commented at 10:57 AM on November 30, 2021: member

    The scantxoutset RPC and its help text was at last improved in #16285, but it's still missing examples (see #16285 (comment)).

    ~Note that the example descriptor used doesn't follow the developer guideline of using invalid bech32 addresses, as the RPC is not wallet-related and it's use-case is merely to look up state information (i.e. there is no danger of sending funds to a wrong address).~ For the sake of simplicity, the raw descriptor for an early coinbase payout address (block 9) is taken, i.e. it yields results even at an early stage of IBD. Happy to change that though if there are other suggestions.

  2. DrahtBot added the label RPC/REST/ZMQ on Nov 30, 2021
  3. shaavan approved
  4. shaavan commented at 12:58 PM on November 30, 2021: contributor

    ACK 0b4487b0d9b2326054f4cb18021eaa366c46f6b8

    The added examples look good and work correctly for bitcoin-cli. Here’s a pair of screenshots comparing the output of the command:

    ./src/bitcoin-cli -signet scantxoutset
    

    on Master and PR branch.

    Screenshot:

    Master PR
    Screenshot from 2021-11-30 18-17-41 Screenshot from 2021-11-30 18-17-04
  5. laanwj commented at 4:07 PM on November 30, 2021: member

    Thanks for adding examples. Concept ACK.

    Note that the example descriptor used doesn't follow the developer guideline of using invalid bech32 addresses, as the RPC is not wallet-related and it's use-case is merely to look up state information

    I think that's fine in this case. Might add a comment in the source to mention this exception so that we don't get follow-up PRs "fixing" this.

  6. MarcoFalke commented at 4:16 PM on November 30, 2021: member

    An alternative would be to use raw(ff00) or raw(76a91411b366edfc0a8b66feebae5c2e25a7b6a5d1cf3188ac)#fm24fxxy or so, which should even work on regtest.

  7. luke-jr approved
  8. luke-jr commented at 11:23 PM on November 30, 2021: member

    utACK, but it might be nice to give one of the examples with a more complicated descriptor instead?

  9. rpc: add missing scantxoutset examples 1ed5681407
  10. theStack force-pushed on Dec 2, 2021
  11. theStack commented at 1:31 PM on December 2, 2021: member

    Thanks for all the reviews!

    I decided to pick up the idea of using a raw descriptor as example, as suggested by MarcoFalke (not sure though about the idea of raw(ff00), as this is an invalid scriptPubKey?). That leads to the same results, but 1.) doesn't interfere with the RPC developer guidelines (use invalid bech32 addresses), avoiding potential follow-up PRs 2.) works also on regtest/signet/testnet, 3.) is a little more sophisticated, also including a checksum.

  12. shaavan approved
  13. shaavan commented at 3:03 PM on December 2, 2021: contributor

    reACK 1ed5681407adc1acc60c9bfebde5819f077f0bf3

    The updated PR is working correctly. Tested successfully that the example:

    ./src/bitcoin-cli -signet scantxoutset start '["raw(76a91411b366edfc0a8b66feebae5c2e25a7b6a5d1cf3188ac)#fm24fxxy"]'
    

    It is working perfectly.

  14. laanwj merged this on Dec 7, 2021
  15. laanwj closed this on Dec 7, 2021

  16. theStack deleted the branch on Dec 7, 2021
  17. sidhujag referenced this in commit f6c0957beb on Dec 7, 2021
  18. luke-jr referenced this in commit 7bc33352b6 on Dec 14, 2021
  19. RandyMcMillan referenced this in commit b9e1bea3e1 on Dec 23, 2021
  20. DrahtBot locked this on Dec 7, 2022

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

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