1

I have a Bitcoin Core wallet which has a utxo which I spent from, in a transaction where around 1% was sent to an external wallet address, with the ~99% change output remaining in the wallet, sent to a new internal change address selected by core.

The fee used turned out to be too low and I am still waiting for the transaction to be confirmed, and now when I attempt to spend using the balance that is displayed in the wallet (with getbalance endpoint), I am told there is "Insufficient funds.".

But when I list the wallet utxos with listunspent, "spendable" has value true for the change output mentioned above - this is what I expected since my understanding is the core wallet by default will use CFPF to still spend an unconfirmed change output (please correct me if this is wrong).

My question is: Why does the output listed by listunspent indicate that the output is 'spendable', when if I try to spend the output, it fails with an 'Insufficient funds' error?

Is there another reason for the wallet complaining that there is insufficient funds? Probably relevant is that it was an opt-in RBF tx, and I have already tried bumping the fee (still too low and not confirmed) but now would prefer to use CPFP as I have another transaction that I would like to make from the same unconfirmed change output.

3
  • 1
    I think you should try CPFP not using your Bitcoin Core. Sounds like the wallet application is locking that balance rather than it actually being unspendable. Something like this will clear it quickly - steemit.com/cryptocurrency/@coincircus/… Nov 25, 2020 at 21:58
  • Really useful resource - thanks. To do this all within Bitcoin Core, would the way to do that be with the createrawtransaction RPC or using another method?
    – qmux
    Nov 26, 2020 at 14:09
  • 1
    That would only be part of it, you would still then have to sign the raw transaction (signrawtransaction) with your priv key and broadcast it (sendrawtransaction). coinb.in is quite a good resource for this with a GUI Nov 27, 2020 at 16:22

1 Answer 1

1

Spending the whole balance of the wallet will always fail, because you cannot assign the whole balance to an output and pay a fee at the same time. There are two ways to sidestep this issue:

  • Instruct sendtoaddress to send the whole balance to one of your own addresses, but to take the fee out of the recipient amount per the subtractfeefromamount argument (on send it's called subtract_fee_from_outputs and you need to indicate which output to take from). Be sure to pick a sufficient feerate¹ to bump the parent transaction.
  • [Not recommended:] Manually calculate the fee you wish to pay and create a transaction with sendrawtransaction that sends balance - fee to a new address in your wallet. Be sure to inspect the transaction before submitting it, manually building transactions has often led to people accidentally sending too much fees.

¹Bitcoin Core has a known issue where it will treat all UTXOs as though they have been confirmed for the purpose of fee calculation. When using an unconfirmed UTXO created by a transaction with a lower feerate, Bitcoin Core will not account for the necessary bump fees to achieve the intended target feerate for the child transaction. You therefore need to choose a higher feerate than where you would actually like to queue the child transaction in order to reprioritize the parent transaction. There is ongoing work to fix this issue and automatically bump unconfirmed ancestor transactions to the requested feerate in PR #26152.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.