Skip to content

rpc: listunspent doesn't return immature coinbase outputs #25728

@danielabrozzoni

Description

@danielabrozzoni

Is your feature request related to a problem? Please describe.

I need to know all the utxos I have in my wallet, including the immature ones. When using listunspent, the immature coinbases are not returned:

❯ bitcoin-cli listtransactions
[
  {
    "address": "bcrt1q0epv47eaxhyenhqcjp8v7wytjx26k35r6w2py6",
    "category": "immature",
    "amount": 50.00000000,
    "label": "",
    "vout": 0,
    "confirmations": 1,
    "generated": true,
    "blockhash": "334996db387320711e1176f2591dfc16fe8d92f617af47ae65b97c2a817758b0",
    "blockheight": 102,
    "blockindex": 0,
    "blocktime": 1658995253,
    "txid": "480f0340a98755cfb095743b5464e87d0cf1b0200d204507ec8448962bcafbe6",
    "walletconflicts": [
    ],
    "time": 1658995253,
    "timereceived": 1658995253,
    "bip125-replaceable": "no"
  }
]
❯ bitcoin-cli listunspent
[
]

Describe the solution you'd like

What do you think of adding a include_immature_coinbase (default to false) parameter to listunspent? If you think it'd be useful, I can start working on this myself.

Describe alternatives you've considered

At the moment I'm calling listtransaction and adding to the utxo list every immature output I see (bitcoindevkit/bdk#687). This works just fine, but having the include_immature parameter would make the code a bit cleaner (and it would save one RPC call!).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions