mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-23 14:40: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:
parent
6373d32f36
commit
01f31e436a
1 changed files with 6 additions and 3 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue