mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
test: fix nil dereference
fixes tests TestLoopOutFailOffchain, TestLoopOutPaymentParameters
This commit is contained in:
parent
fe747a0670
commit
cc26813f24
2 changed files with 19 additions and 2 deletions
|
|
@ -151,7 +151,7 @@ func (ctx *Context) AssertPaid(
|
|||
return done
|
||||
}
|
||||
|
||||
// Assert that client pays swap invoice.
|
||||
// Assert that the client pays swap invoice.
|
||||
for {
|
||||
var swapPayment RouterPaymentChannelMessage
|
||||
select {
|
||||
|
|
@ -171,7 +171,12 @@ func (ctx *Context) AssertPaid(
|
|||
|
||||
done := func(result error) {
|
||||
if result != nil {
|
||||
swapPayment.Errors <- result
|
||||
// Send a terminal FAILED status so the client
|
||||
// always receives a non-nil PaymentStatus and
|
||||
// won't dereference nil.
|
||||
swapPayment.Updates <- lndclient.PaymentStatus{
|
||||
State: lnrpc.Payment_FAILED,
|
||||
}
|
||||
return
|
||||
}
|
||||
swapPayment.Updates <- lndclient.PaymentStatus{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue