Skip to content

Commit

Permalink
itest: ensure peer is connected befor channel open
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ellemouton committed Feb 13, 2025
1 parent d56ba68 commit 046dcab
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions itest/litd_firewall_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1399,6 +1399,17 @@ func testChannelOpening(net *NetworkHarness, ht *harnessTest, t *testing.T) {

caveatCreds = metaDataInjector.addCaveat(caveat)

// Make sure to reconnect to Charlie after the restart.
_, err = lndConn2.ConnectPeer(
ctx, &lnrpc.ConnectPeerRequest{
Addr: &lnrpc.LightningAddress{
Pubkey: charlie.PubKeyStr,
Host: charlie.Cfg.P2PAddr(),
},
}, caveatCreds,
)
require.NoError(t, err)

memoBefore := lastMemo
openResp, err = lndConn2.OpenChannelSync(
ctx, &lnrpc.OpenChannelRequest{
Expand Down

0 comments on commit 046dcab

Please sign in to comment.