minFinalExpiryDelta is not optional#2195
Merged
Merged
Conversation
pm47
reviewed
Mar 1, 2022
Member
pm47
left a comment
There was a problem hiding this comment.
I got confused at first: we cannot put a hard requirement on the existence of that field in Bolt11Invoice along the existing ones, because it wasn't always mandatory (lightning/bolts#785):
require(tags.collect { case _: Bolt11Invoice.MinFinalCltvExpiry=> }.size == 1, "there must be exactly one min_final_cltv_expiry tag")An invoice that doesn't explicitly set min_final_cltv_expiry has an default min_final_cltv_expiry of 18. This default allows invoices to be slightly shorter but does not mean that the min_final_cltv_expiry can be unknown and needs to be provided from somewhere else.
b36d22f to
0edf486
Compare
0edf486 to
f879a97
Compare
pm47
reviewed
Mar 1, 2022
aaabecc to
607271a
Compare
Codecov Report
@@ Coverage Diff @@
## master #2195 +/- ##
==========================================
- Coverage 83.95% 83.95% -0.01%
==========================================
Files 186 186
Lines 13916 13915 -1
Branches 578 564 -14
==========================================
- Hits 11683 11682 -1
Misses 2233 2233
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
In invoices,
minFinalCltvExpiryDeltais not optional.An invoice that doesn't explicitly set min_final_cltv_expiry has an default min_final_cltv_expiry of 18.
This default allows invoices to be slightly shorter but does not mean that the min_final_cltv_expiry can be unknown and needs to be provided from somewhere else.