-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
minFinalExpiryDelta is not optional #2195
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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")
eclair-core/src/main/scala/fr/acinq/eclair/payment/Bolt11Invoice.scala
Outdated
Show resolved
Hide resolved
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
eclair-core/src/main/scala/fr/acinq/eclair/json/JsonSerializers.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/payment/Bolt11Invoice.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/channel/Channel.scala
Outdated
Show resolved
Hide resolved
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice cleanup!
In invoices,
minFinalCltvExpiryDelta
is 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.