lntest/itest: move chanpoint instantiation down to where it's used
This commit is contained in:
parent
b03d8edcd9
commit
8e10da03c7
@ -2247,9 +2247,19 @@ func testDisconnectingTargetPeer(net *lntest.NetworkHarness, t *harnessTest) {
|
|||||||
t.Fatalf("unable to assert channel existence: %v", err)
|
t.Fatalf("unable to assert channel existence: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finally, immediately close the channel. This function will also
|
// Disconnect Alice-peer from Bob-peer and get error causes by one
|
||||||
// block until the channel is closed and will additionally assert the
|
// active channel with detach node is existing.
|
||||||
// relevant channel closing post conditions.
|
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{
|
chanPoint := &lnrpc.ChannelPoint{
|
||||||
FundingTxid: &lnrpc.ChannelPoint_FundingTxidBytes{
|
FundingTxid: &lnrpc.ChannelPoint_FundingTxidBytes{
|
||||||
FundingTxidBytes: pendingUpdate.Txid,
|
FundingTxidBytes: pendingUpdate.Txid,
|
||||||
@ -2257,16 +2267,6 @@ func testDisconnectingTargetPeer(net *lntest.NetworkHarness, t *harnessTest) {
|
|||||||
OutputIndex: pendingUpdate.OutputIndex,
|
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)
|
ctxt, _ = context.WithTimeout(ctxb, channelCloseTimeout)
|
||||||
closeChannelAndAssert(ctxt, t, net, net.Alice, chanPoint, true)
|
closeChannelAndAssert(ctxt, t, net, net.Alice, chanPoint, true)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user