multi: replace DefaultDustLimit with accurate dust limit#5781
Merged
Roasbeef merged 3 commits intolightningnetwork:masterfrom Sep 29, 2021
Merged
multi: replace DefaultDustLimit with accurate dust limit#5781Roasbeef merged 3 commits intolightningnetwork:masterfrom
Roasbeef merged 3 commits intolightningnetwork:masterfrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit overview
multi: replace DefaultDustLimit with script-specific DustLimitForScriptupdates all call-sites toDustLimitForScriptwhich takes a pkscript size and calculates the dust-limit. This also fixes thesendcoinsCLI 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 thelndcodebase.funding+lnwallet: validate ChannelReserve is above DustLimitvalidates that both sides'ChannelReserveare 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
DustLimitForScripttake into account different back-end minimum relay fees? The underlyingbtcd.GetDustThresholddoes not.Fixes #3946