mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-03 02:02:17 +02:00
routing/payment_lifecycle: return recorded errors
In preparation for MPP we return the terminal errors recorded with the control tower. The reason is that we cannot return immediately when a shard fails for MPP, since there might be more shards in flight that we must wait for. For that reason we instead mark the payment failed in the control tower, then return this error when we inspect the payment, seeing it has been failed and there are no shards in flight.
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
||||
"image/color"
|
||||
"math"
|
||||
"math/rand"
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -792,9 +791,8 @@ func TestSendPaymentErrorPathPruning(t *testing.T) {
|
||||
|
||||
// The final error returned should also indicate that the peer wasn't
|
||||
// online (the last error we returned).
|
||||
// TODO: proper err code
|
||||
if !strings.Contains(err.Error(), "unable to find") {
|
||||
t.Fatalf("expected UnknownNextPeer instead got: %v", err)
|
||||
if err != channeldb.FailureReasonNoRoute {
|
||||
t.Fatalf("expected no route instead got: %v", err)
|
||||
}
|
||||
|
||||
// Inspect the two attempts that were made before the payment failed.
|
||||
|
Reference in New Issue
Block a user