lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.63k stars 2.07k forks source link

[feature]: lncli command for walletrpc.EstimateFee #8726

Closed feelancer21 closed 2 months ago

feelancer21 commented 4 months ago

I am looking for a lncli command returning the sat_per_kw for a given conf_target. There is walletrpc.EstimateFee, but I cannot find a corresponding lncli command for this. I found lncli estimatefee but this calls lnrpc.EstimateFee.

Have I missed something?

Chinwendu20 commented 4 months ago

how about this? https://github.com/lightningnetwork/lnd/blob/399ea864da54ff28e07c17f877221395164e498b/cmd/lncli/commands.go#L212-L268

feelancer21 commented 4 months ago

how about this?

It is not exactly the same. For lnrpc.EstimateFee you have to provice adresses in a json string to get the feerate. It's fine for the usecase of estimating the exact fee in satoshis for a transaction. If you only like to know the current onchain feerate you don't need the overhead of providing the json string.

guggero commented 4 months ago

Maybe the new command should therefore be called estimatefeerate to distinguish better between the two use cases?

feelancer21 commented 4 months ago

Maybe the new command should therefore be called estimatefeerate to distinguish better between the two use cases?

Made a PR yesterday. Named it estimatefee too but placed it as subcommand for wallet, because it calls walletrpc. But now there are two cli.commands with the same name. Not really sure if there are unseen side effects.

But maybe better to discuss it here. https://github.com/lightningnetwork/lnd/pull/8730