return incorrect details on probing when connected

This commit is contained in:
Jesse de Wit
2022-12-22 13:54:46 +01:00
parent c939a2d493
commit 58367bafef
2 changed files with 5 additions and 5 deletions

View File

@@ -77,7 +77,7 @@ func intercept(reqPaymentHash []byte, reqOutgoingAmountMsat uint64, reqOutgoingE
} else { //probing
failureCode := FAILURE_TEMPORARY_CHANNEL_FAILURE
isConnected, _ := client.IsConnected(destination)
if err != nil || !isConnected {
if isConnected {
failureCode = FAILURE_INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS
}

View File

@@ -59,8 +59,8 @@ func testProbing(p *testParams) {
route := constructRoute(p.lsp.LightningNode(), p.BreezClient().Node(), channelId, lntest.NewShortChanIDFromString("1x0x0"), outerAmountMsat)
_, err := alice.PayViaRoute(outerAmountMsat, fakePaymentHash, outerInvoice.paymentSecret, route)
// Expect temporary channel failure if the peer is online
assert.Contains(p.t, err.Error(), "WIRE_TEMPORARY_CHANNEL_FAILURE")
// Expect incorrect or unknown payment details if the peer is online
assert.Contains(p.t, err.Error(), "WIRE_INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS")
// Kill the mobile client
log.Printf("Stopping breez client")
@@ -69,6 +69,6 @@ func testProbing(p *testParams) {
log.Printf("Alice paying with fake payment hash with Bob offline %x", fakePaymentHash)
_, err = alice.PayViaRoute(outerAmountMsat, fakePaymentHash, outerInvoice.paymentSecret, route)
// Expect incorrect or unknown payment details if the peer is offline
assert.Contains(p.t, err.Error(), "WIRE_INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS")
// Expect temporary channel failure if the peer is offline
assert.Contains(p.t, err.Error(), "WIRE_TEMPORARY_CHANNEL_FAILURE")
}