lightning icon indicating copy to clipboard operation
lightning copied to clipboard

[Feature Request] Add "dryrun" optional parameter for withdraw

Open Impa10r opened this issue 1 year ago • 3 comments

Issue and Steps to Reproduce

The withdraw endpoint pays incorrect fee rate. Here is an example where I asked it to pay 51 sat/vB (via glightning API, but it paid 54.4). It is even worse for withdrawals with no change.

I'd like to be able to run it without actually posting the transaction, so I can go back and fudge the feerate input or amend the psbt and send it instead. This could be easily achieved by an additional optional parameter dryrun. It should still return tx (hex), txid (txid) and psbt (string), just not broadcast the transaction.

getinfo output

"version": "v24.05",

Impa10r avatar Aug 15 '24 13:08 Impa10r

This kind of makes sense for "check" to do this, and return optional extra data? At the moment check doesn't return anything useful in success, but we could enhance that?

rustyrussell avatar Sep 04 '24 08:09 rustyrussell

This kind of makes sense for "check" to do this, and return optional extra data? At the moment check doesn't return anything useful in success, but we could enhance that?

I don't know how check works. I just want to get rawHex from withdraw endpoint.

Impa10r avatar Sep 04 '24 09:09 Impa10r

This kind of makes sense for "check" to do this, and return optional extra data? At the moment check doesn't return anything useful in success, but we could enhance that?

There is no "check" in glightning, so it won't help me if you implement this only for lightning-cli. I can't think how you can do "check" API for any possible endpoint in Go, with all their parameters. I think adding one option to withdraw is more feasible.

Impa10r avatar Sep 08 '24 13:09 Impa10r