lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.58k stars 2.06k forks source link

[bug]: BatchOpenChannel RPC will always use 6 confirmation target for the fee estimation #8895

Closed ziggie1984 closed 1 day ago

ziggie1984 commented 3 weeks ago

Currently you cannot control the feerate when using the BatchOpenChannel API, it will default to a conftarget of 6.

Culprit lies here:

We excluded the fee estimation logic when using the psbt flow but the batchopen flow uses the psbt funding flow so we cannot do so.

https://github.com/lightningnetwork/lnd/blob/71ba355d903f01990718866c358c2ccac9402891/rpcserver.go#L2176-L2195

Moreover using pointer here, shadowed the bug unfortunately which caused us to use 6 rather then failing with an error.

https://github.com/lightningnetwork/lnd/blob/master/server.go#L4521-L4566

Going to provide a fix asap.

bitromortac commented 3 weeks ago

Does it ignore the target field? Setting SatPerVbyte seems to work for me.

ziggie1984 commented 3 weeks ago

it ignores the whole fee calc., can you verify that your selected feerate and the fee estimation of 6 blocks did not by incident just were the same ?

Its a bug introduced in 18, so it would work just fine with 17

bitromortac commented 3 weeks ago

Right that could be the case, will double check.