diff --git a/channeldb/payment_control_test.go b/channeldb/payment_control_test.go index 5272ec79a..063a2e6f5 100644 --- a/channeldb/payment_control_test.go +++ b/channeldb/payment_control_test.go @@ -116,9 +116,18 @@ func TestPaymentControlSwitchFail(t *testing.T) { nil, ) - // Record a new attempt. + // Record a new attempt. In this test scenario, the attempt fails. + // However, this is not communicated to control tower in the current + // implementation. It only registers the initiation of the attempt. attempt.AttemptID = 2 err = pControl.RegisterAttempt(info.PaymentHash, attempt) + if err != nil { + t.Fatalf("unable to register attempt: %v", err) + } + + // Record another attempt. + attempt.AttemptID = 3 + err = pControl.RegisterAttempt(info.PaymentHash, attempt) if err != nil { t.Fatalf("unable to send htlc message: %v", err) } @@ -128,7 +137,7 @@ func TestPaymentControlSwitchFail(t *testing.T) { nil, ) - // Verifies that status was changed to StatusSucceeded. + // Settle the attempt and verify that status was changed to StatusSucceeded. var payment *MPPayment payment, err = pControl.Success(info.PaymentHash, preimg) if err != nil {