diff --git a/htlcswitch/test_utils.go b/htlcswitch/test_utils.go index 0d6f3b4d..c997c4f9 100644 --- a/htlcswitch/test_utils.go +++ b/htlcswitch/test_utils.go @@ -1345,15 +1345,13 @@ func (n *twoHopNetwork) makeHoldPayment(sendingPeer, receivingPeer lnpeer.Peer, } // Send payment and expose err channel. - go func() { - err := sender.htlcSwitch.SendHTLC( - firstHop, pid, htlc, - ) - if err != nil { - paymentErr <- err - return - } + err = sender.htlcSwitch.SendHTLC(firstHop, pid, htlc) + if err != nil { + paymentErr <- err + return paymentErr + } + go func() { resultChan, err := sender.htlcSwitch.GetPaymentResult( pid, rhash, newMockDeobfuscator(), )