always return incorrect details on probes

This commit is contained in:
Jesse de Wit
2022-12-22 15:33:09 +01:00
parent c42db2f968
commit b6894e7337
2 changed files with 2 additions and 8 deletions

View File

@@ -75,15 +75,9 @@ func intercept(reqPaymentHash []byte, reqOutgoingAmountMsat uint64, reqOutgoingE
}, nil }, nil
} }
} else { //probing } else { //probing
failureCode := FAILURE_TEMPORARY_CHANNEL_FAILURE
isConnected, _ := client.IsConnected(destination)
if isConnected {
failureCode = FAILURE_INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS
}
return interceptResult{ return interceptResult{
action: INTERCEPT_FAIL_HTLC_WITH_CODE, action: INTERCEPT_FAIL_HTLC_WITH_CODE,
failureCode: failureCode, failureCode: FAILURE_INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS,
}, nil }, nil
} }
} }

View File

@@ -70,5 +70,5 @@ func testProbing(p *testParams) {
_, err = alice.PayViaRoute(outerAmountMsat, fakePaymentHash, outerInvoice.paymentSecret, route) _, err = alice.PayViaRoute(outerAmountMsat, fakePaymentHash, outerInvoice.paymentSecret, route)
// Expect temporary channel failure if the peer is offline // Expect temporary channel failure if the peer is offline
assert.Contains(p.t, err.Error(), "WIRE_TEMPORARY_CHANNEL_FAILURE") assert.Contains(p.t, err.Error(), "WIRE_INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS")
} }