Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
fundchannel: add the possibility to fund a channel with specific utxos #2699
2 times, most recently
Jun 2, 2019
niftynei left a comment
Lots of little things, nice work overall!
I think the biggest question is whether or not we want to have this in addition to the 'amount' field. It seems like it'd be nice to be able to specify a utxo set and a total amount to fund as well, which isn't possible with the current design.
How you do you see people using this @darosior ?
Agree with all @niftynei feedback. In particular, I think adding a separate optional 'utxos' param is nicer: if not specified, utxos are selected from current wallet utxos as now. That does allow us to have a change output from UTXOs if we want to (or 'all' if we don't).
Thank you for the review @niftynei .
EDIT: misread the comment above, especially
Sorry, you really can't do the API this way. As @niftynei points out, you may well want to specify both utxos and the amount to spend, so it needs to be a separate 'utxos' argument.
And while txid:outnum is neat on the commandline, it's nasty JSON. You can always create a plugin which does converts from this syntax :)
When saying "let's do this" I meant "ok I'll work on the separate 'utxos' argument version" (I was not pushing the initial implementation without argument ^^), it's a translated sentence from french and has apparently not the same signification in english.
I just saw your comment now that I finished to work on the new implementation. I finally kept using JSON as you requested (I added a bitcoin_txid json helper), relying on the fact that a txid would always be 64 hex characters long.
EDIT: A new json helper was already merged along with #2713 , rebased below .