[rpc] Include immature coinbase in listunspent #17028

pull andrewtoth wants to merge 2 commits into bitcoin:master from andrewtoth:listunspent-immature changing 5 files +54 −7
  1. andrewtoth commented at 8:15 PM on October 2, 2019: contributor

    listunspent help text is

    Returns array of unspent transaction outputs
    with between minconf and maxconf (inclusive) confirmations.
    Optionally filter to only include txouts paid to specified addresses.
    

    Based on that it seems that not returning immature coinbase outputs is an error. They should be returned with the safe field being set to false.

  2. Include immature coinbase outputs with listunspent 0eeab23641
  3. andrewtoth force-pushed on Oct 2, 2019
  4. Test for immature coinbase outputs with listunspent 8c0bbe5d09
  5. andrewtoth force-pushed on Oct 2, 2019
  6. DrahtBot added the label RPC/REST/ZMQ on Oct 2, 2019
  7. DrahtBot added the label Tests on Oct 2, 2019
  8. DrahtBot added the label Wallet on Oct 2, 2019
  9. achow101 commented at 12:08 AM on October 3, 2019: member

    Concept NACK

    IMO listunspent should really only list UTXOs which are spendable as it's often used for manual coin selection. Changing this would mean that someone who is using listunspent to get UTXOs to pass into some other software that does coin selection could accidentally select a UTXO that is not spendable.

  10. promag commented at 11:25 PM on October 3, 2019: member

    Agree with @achow101. Maybe clarify help text that immature unspents aren't returned?

  11. andrewtoth commented at 6:19 PM on October 4, 2019: contributor

    @achow101 I believe that is what the unsafe flag is for. So this rpc will already return potentially unspendable outputs by default, unless the include unsafe is explicitly set to false.

  12. meshcollider commented at 11:50 PM on October 7, 2019: contributor

    @andrewtoth unsafe is different from unspendable. Immature coinbase transactions are the latter. Waiting for X number of confirmations is a users choice based on their risk, but immature coinbase is not up to the user. Closing this as it has no agreement

  13. meshcollider closed this on Oct 7, 2019

  14. bitcoin locked this on Dec 16, 2021
  15. andrewtoth deleted the branch on Aug 17, 2023

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