0

I noticed that when I call listunspent on Bitcoin Core, UTXO with 0 confirmation are labeled unsafe, and thus prevented from being spent with sendtoaddress or fundrawtransaction. As soon as there's one confirmation the tx is safe and I can spend it.

Being able to modify the target for a tx to be considered safe, for example set it to 3 or 6 confirmations instead of just 1, would make my life easier, but I can't find an option for it. Is there some way to do it?

1
  • 1
    You could set minconf=3 or minconf=6 for that matter; you can also parse depending on the confirmations field instead of the safe one. Commented Jun 6, 2020 at 14:06

1 Answer 1

0

From the documentation:

listunspent ( minconf maxconf ["address",...] include_unsafe query_options )

Returns array of unspent transaction outputs with between minconf and maxconf (inclusive) confirmations.

so listunspent 3 would work for you?

2
  • Yes that's what I do now, but I was wondering if there was a way to modify the safe parameter to totally avoid the risk of picking an UTXO that have less than x confirmations in a transaction. You can also use the lockunspent command for the same purpose.
    – Sosthène
    Commented May 14, 2020 at 10:40
  • 1
    You'd need to recompile Core for that.
    – MCCCS
    Commented May 14, 2020 at 11:36

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.