From 58367bafef099e1834abf0b08f4ab759407588d2 Mon Sep 17 00:00:00 2001 From: Jesse de Wit Date: Thu, 22 Dec 2022 13:54:46 +0100 Subject: [PATCH] return incorrect details on probing when connected --- intercept.go | 2 +- itest/probing_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/intercept.go b/intercept.go index 92edc0b..7d522d8 100644 --- a/intercept.go +++ b/intercept.go @@ -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 } diff --git a/itest/probing_test.go b/itest/probing_test.go index a11818e..fb53fc1 100644 --- a/itest/probing_test.go +++ b/itest/probing_test.go @@ -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") }