mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2026-02-21 22:44:30 +01:00
itest: fix node names out of bounds
If the last channel fails, the indexing into nodeNames would panic. We instead name the channels, such that the slices will be of the same length.
This commit is contained in:
@@ -6726,7 +6726,10 @@ func testInvoiceRoutingHints(net *lntest.NetworkHarness, t *harnessTest) {
|
||||
)
|
||||
|
||||
// Make sure all the channels have been opened.
|
||||
nodeNames := []string{"bob", "carol", "dave", "eve"}
|
||||
chanNames := []string{
|
||||
"alice-bob", "alice-carol", "bob-carol", "alice-dave",
|
||||
"alice-eve",
|
||||
}
|
||||
aliceChans := []*lnrpc.ChannelPoint{
|
||||
chanPointBob, chanPointCarol, chanPointBobCarol, chanPointDave,
|
||||
chanPointEve,
|
||||
@@ -6735,8 +6738,8 @@ func testInvoiceRoutingHints(net *lntest.NetworkHarness, t *harnessTest) {
|
||||
ctxt, _ := context.WithTimeout(ctxb, defaultTimeout)
|
||||
err = net.Alice.WaitForNetworkChannelOpen(ctxt, chanPoint)
|
||||
if err != nil {
|
||||
t.Fatalf("timed out waiting for channel open between "+
|
||||
"alice and %s: %v", nodeNames[i], err)
|
||||
t.Fatalf("timed out waiting for channel open %s: %v",
|
||||
chanNames[i], err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user