Closes #32098.
Currently, only coinbase UTXOs that are mature at height h are available for coin selection. This PR makes UTXOs that mature at height h+1 available for selection.
Since a transaction spending this output will be accepted by the mempool, it should be available for selection.
BDK implements this logic1, which I believe to be the correct one.
0$ bitcoin-cli -regtest createwallet wallet
1{
2 "name": "wallet"
3}
4
5$ export DESCRIPTOR=$(bitcoin-cli -regtest -rpcwallet=wallet listdescriptors | jq -r '.descriptors[] | select(.internal==false and (.desc | startswith("wpkh"))) | .desc')
6
7$ export ADDRESS=$(bitcoin-cli -regtest -rpcwallet=wallet getnewaddress)
8
9$ bitcoin-cli -regtest generatetoaddress 101 $ADDRESS
10[
11 "467fd440d0ed89d0cad64fa64d0320968b33a32c681b6c3f5a5ed1d1c016f45a",
12 "1b2246eaa35689710acc5d1bb2923197993233fb9186f0bd561cb546c7667ca7",
13 ...
14 "5d5ee44ada395ab1d978a77596ed3893be750840229e7234a85a01984057798a",
15 "7f8a573a6824edc5342cf86e5e7c0a6ea5664305ef21808456fc98b2621b41cf"
16]
17
18$ bitcoin-cli -regtest -rpcwallet=wallet getbalance
19- 50.00000000
20+ 100.00000000