File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -227,7 +227,7 @@ enum channel_add_err channel_add_htlc(struct channel *channel,
227227 enum side sender ,
228228 u64 id ,
229229 u64 msatoshi ,
230- u32 expiry ,
230+ u32 cltv_expiry ,
231231 const struct sha256 * payment_hash ,
232232 const u8 routing [1254 ])
233233{
@@ -248,7 +248,12 @@ enum channel_add_err channel_add_htlc(struct channel *channel,
248248 htlc -> state = RCVD_ADD_HTLC ;
249249 htlc -> id = id ;
250250 htlc -> msatoshi = msatoshi ;
251- if (!blocks_to_abs_locktime (expiry , & htlc -> expiry ))
251+ /* BOLT #2:
252+ *
253+ * A receiving node SHOULD fail the channel if a sending node... sets
254+ * `cltv-expiry` to greater or equal to 500000000.
255+ */
256+ if (!blocks_to_abs_locktime (cltv_expiry , & htlc -> expiry ))
252257 return CHANNEL_ERR_INVALID_EXPIRY ;
253258 htlc -> rhash = * payment_hash ;
254259 htlc -> r = NULL ;
Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ enum channel_add_err {
207207 * @offerer: the side offering the HTLC (to the other side).
208208 * @id: unique HTLC id.
209209 * @msatoshi: amount in millisatoshi.
210- * @expiry : block number when HTLC can no longer be redeemed.
210+ * @cltv_expiry : block number when HTLC can no longer be redeemed.
211211 * @payment_hash: hash whose preimage can redeem HTLC.
212212 * @routing: routing information (copied)
213213 *
@@ -219,7 +219,7 @@ enum channel_add_err channel_add_htlc(struct channel *channel,
219219 enum side sender ,
220220 u64 id ,
221221 u64 msatoshi ,
222- u32 expiry ,
222+ u32 cltv_expiry ,
223223 const struct sha256 * payment_hash ,
224224 const u8 routing [1254 ]);
225225
You can’t perform that action at this time.
0 commit comments