Skip to content

multi: replace DefaultDustLimit with accurate dust limit#5781

Merged
Roasbeef merged 3 commits intolightningnetwork:masterfrom
Crypt-iQ:accurate_dust0922
Sep 29, 2021
Merged

multi: replace DefaultDustLimit with accurate dust limit#5781
Roasbeef merged 3 commits intolightningnetwork:masterfrom
Crypt-iQ:accurate_dust0922

Conversation

@Crypt-iQ
Copy link
Collaborator

Commit overview

  • multi: replace DefaultDustLimit with script-specific DustLimitForScript updates all call-sites to DustLimitForScript which takes a pkscript size and calculates the dust-limit. This also fixes the sendcoins CLI command to be able to send 294 satoshis to a p2wpkh output for example. With this commit, the previous 573 limit should no longer be in the lnd codebase.
  • funding+lnwallet: validate ChannelReserve is above DustLimit validates that both sides' ChannelReserve are above both sides' DustLimit. This is implied by BOLT#02 but should be made explicit. I will follow up with a patch to the spec to do this. We also implement Allowing dust limit below 546 sats lightning/bolts#905 along the way by ensuring we send a dust limit that other implementations accept. This dust limit is 354 satoshis by default (the dust limit for a maximally sized witness output with a 40-byte data push).

Q: Should DustLimitForScript take into account different back-end minimum relay fees? The underlying btcd.GetDustThreshold does not.

Fixes #3946

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lnwallet: incorrect dust limit applied for p2wkh outputs

3 participants