mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 22:25:24 +01:00
lntest/itest: move chanpoint instantiation down to where it's used
This commit is contained in:
parent
b03d8edcd9
commit
8e10da03c7
1 changed files with 13 additions and 13 deletions
|
@ -2247,9 +2247,19 @@ func testDisconnectingTargetPeer(net *lntest.NetworkHarness, t *harnessTest) {
|
|||
t.Fatalf("unable to assert channel existence: %v", err)
|
||||
}
|
||||
|
||||
// Finally, immediately close the channel. This function will also
|
||||
// block until the channel is closed and will additionally assert the
|
||||
// relevant channel closing post conditions.
|
||||
// Disconnect Alice-peer from Bob-peer and get error causes by one
|
||||
// active channel with detach node is existing.
|
||||
if err := net.DisconnectNodes(ctxt, alice, bob); err == nil {
|
||||
t.Fatalf("Bob's peer was disconnected from Alice's"+
|
||||
" while one active channel is existing: err %v", err)
|
||||
}
|
||||
|
||||
// Check existing connection.
|
||||
assertNumConnections(t, alice, bob, 1)
|
||||
|
||||
// Finally, immediately close the channel. This function will also block
|
||||
// until the channel is closed and will additionally assert the relevant
|
||||
// channel closing post conditions.
|
||||
chanPoint := &lnrpc.ChannelPoint{
|
||||
FundingTxid: &lnrpc.ChannelPoint_FundingTxidBytes{
|
||||
FundingTxidBytes: pendingUpdate.Txid,
|
||||
|
@ -2257,16 +2267,6 @@ func testDisconnectingTargetPeer(net *lntest.NetworkHarness, t *harnessTest) {
|
|||
OutputIndex: pendingUpdate.OutputIndex,
|
||||
}
|
||||
|
||||
// Disconnect Alice-peer from Bob-peer and get error
|
||||
// causes by one active channel with detach node is existing.
|
||||
if err := net.DisconnectNodes(ctxt, net.Alice, net.Bob); err == nil {
|
||||
t.Fatalf("Bob's peer was disconnected from Alice's"+
|
||||
" while one active channel is existing: err %v", err)
|
||||
}
|
||||
|
||||
// Check existing connection.
|
||||
assertNumConnections(t, net.Alice, net.Bob, 1)
|
||||
|
||||
ctxt, _ = context.WithTimeout(ctxb, channelCloseTimeout)
|
||||
closeChannelAndAssert(ctxt, t, net, net.Alice, chanPoint, true)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue