mirror of
https://github.com/aljazceru/lspd.git
synced 2026-01-07 16:14:28 +01:00
fix the lsps2 cltv delta check
It was wrongly assumed that the lsp had to enforce a cltv delta +2. It is actually the recipient creating invoices with a cltv delta +2, but the LSP does not have anything to do with that.
This commit is contained in:
@@ -314,13 +314,13 @@ func Test_NoMpp_AmtAboveMaximum(t *testing.T) {
|
||||
}
|
||||
|
||||
// Asserts that a no-MPP+var-invoice mode payment fails when the cltv delta is
|
||||
// less than cltv delta + 2.
|
||||
// less than cltv delta.
|
||||
func Test_NoMpp_CltvDeltaBelowMinimum(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
i := setupInterceptor(ctx, nil)
|
||||
|
||||
res := i.Intercept(createPart(&part{cltvDelta: 145}))
|
||||
res := i.Intercept(createPart(&part{cltvDelta: 143}))
|
||||
assert.Equal(t, common.INTERCEPT_FAIL_HTLC_WITH_CODE, res.Action)
|
||||
assert.Equal(t, common.FAILURE_INCORRECT_CLTV_EXPIRY, res.FailureCode)
|
||||
assertEmpty(t, i)
|
||||
@@ -533,13 +533,13 @@ func Test_Mpp_BadSecondPart_ThirdPartCompletes(t *testing.T) {
|
||||
}
|
||||
|
||||
// Asserts that a MPP+fixed-invoice mode payment fails when the cltv delta is
|
||||
// less than cltv delta + 2.
|
||||
// less than cltv delta.
|
||||
func Test_Mpp_CltvDeltaBelowMinimum(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
i := setupInterceptor(ctx, &interceptP{store: mppStore()})
|
||||
|
||||
res := i.Intercept(createPart(&part{cltvDelta: 145}))
|
||||
res := i.Intercept(createPart(&part{cltvDelta: 143}))
|
||||
assert.Equal(t, common.INTERCEPT_FAIL_HTLC_WITH_CODE, res.Action)
|
||||
assert.Equal(t, common.FAILURE_INCORRECT_CLTV_EXPIRY, res.FailureCode)
|
||||
assertEmpty(t, i)
|
||||
|
||||
Reference in New Issue
Block a user