lightninglabs / lightning-terminal

Lightning Terminal: Your Home for Lightning Liquidity
MIT License
488 stars 82 forks source link

Terminal allows creating loop with a transaction that has a too low feerate #700

Open mrfelton opened 6 months ago

mrfelton commented 6 months ago

I used terminal to do a loop in. The onchain transaction was created with a super low fee (7.5 sat/vB at a time when next block rate was ~400 and most nodes were purging / not relaying transactions under 20 sat/vB). As a result the transaction never made it into the mempool.

Expected behavior

The terminal UI shouldn't allow me to use a confirmation target where the resulting fee rate would be so low that the transaction would not get relayed.

Actual behavior

I was able to initiate a loop in with a transaction that didn't get relayed.

To reproduce

Use terminal to do a loop in and set the conf target far into the future such that the resulting fee rate would be below the current min feerate.

System information

Running latest version of terminal standalone, using terminal web.

levmi commented 6 months ago

Hiya- thanks for the report! Did you explicitly set a high confirmation target in the UI? What would your expectation be with regard to how the UI responds to that custom input? Essentially, you'd want the UI to provide context that the selected confirmation target would result in a sats/vbyte that wouldn't get relayed I assume? :)

mrfelton commented 5 months ago

Did you explicitly set a high confirmation target in the UI?

I did.

What would your expectation be with regard to how the UI responds to that custom input? Essentially, you'd want the UI to provide context that the selected confirmation target would result in a sats/vbyte that wouldn't get relayed I assume? :)

Yeah, I think it should compare the fee rate of the selected conf target with the min relay rate and either provide a warning advising against, or outright preventing the user from being able to submit with a conf target that will result in a transaction that won't get relayed.