Skip to content

Commit 046dcab

Browse files
committed
itest: ensure peer is connected befor channel open
After restarting the node, it will only actively connect to peers that it has channels with. Since `assertChannelExistsAndClose` will close the channels the node has with its peer right before shutdown, we cannot guarantee that they are connected on start up and so need to actively connect them.
1 parent d56ba68 commit 046dcab

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

itest/litd_firewall_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,6 +1399,17 @@ func testChannelOpening(net *NetworkHarness, ht *harnessTest, t *testing.T) {
13991399

14001400
caveatCreds = metaDataInjector.addCaveat(caveat)
14011401

1402+
// Make sure to reconnect to Charlie after the restart.
1403+
_, err = lndConn2.ConnectPeer(
1404+
ctx, &lnrpc.ConnectPeerRequest{
1405+
Addr: &lnrpc.LightningAddress{
1406+
Pubkey: charlie.PubKeyStr,
1407+
Host: charlie.Cfg.P2PAddr(),
1408+
},
1409+
}, caveatCreds,
1410+
)
1411+
require.NoError(t, err)
1412+
14021413
memoBefore := lastMemo
14031414
openResp, err = lndConn2.OpenChannelSync(
14041415
ctx, &lnrpc.OpenChannelRequest{

0 commit comments

Comments
 (0)