diff --git a/lnd_test.go b/lnd_test.go index 291e0aa7..05f11ea8 100644 --- a/lnd_test.go +++ b/lnd_test.go @@ -900,8 +900,8 @@ func testMaxPendingChannels(net *networkHarness, t *harnessTest) { chanPoints := make([]*lnrpc.ChannelPoint, maxPendingChannels) for i, stream := range openStreams { - ctx, _ = context.WithTimeout(context.Background(), timeout) - fundingChanPoint, err := net.WaitForChannelOpen(ctx, stream) + ctxt, _ := context.WithTimeout(context.Background(), timeout) + fundingChanPoint, err := net.WaitForChannelOpen(ctxt, stream) if err != nil { t.Fatalf("error while waiting for channel open: %v", err) } diff --git a/lnwallet/channel.go b/lnwallet/channel.go index 82458848..f13a3959 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -1949,11 +1949,10 @@ func (lc *LightningChannel) InitCooperativeClose() ([]byte, *wire.ShaHash, error // been initiated. lc.status = channelClosing - // TODO(roasbeef): assumes initiator pays fees closeTx := CreateCooperativeCloseTx(lc.fundingTxIn, lc.channelState.OurBalance, lc.channelState.TheirBalance, lc.channelState.OurDeliveryScript, lc.channelState.TheirDeliveryScript, - true) + lc.channelState.IsInitiator) closeTxSha := closeTx.TxSha() // Finally, sign the completed cooperative closure transaction. As the @@ -1995,7 +1994,7 @@ func (lc *LightningChannel) CompleteCooperativeClose(remoteSig []byte) (*wire.Ms closeTx := CreateCooperativeCloseTx(lc.fundingTxIn, lc.channelState.OurBalance, lc.channelState.TheirBalance, lc.channelState.OurDeliveryScript, lc.channelState.TheirDeliveryScript, - false) + lc.channelState.IsInitiator) // With the transaction created, we can finally generate our half of // the 2-of-2 multi-sig needed to redeem the funding output. diff --git a/lnwallet/interface_test.go b/lnwallet/interface_test.go index 868cb1d2..4eaeab13 100644 --- a/lnwallet/interface_test.go +++ b/lnwallet/interface_test.go @@ -496,7 +496,7 @@ func testDualFundingReservationWorkflow(miner *rpctest.Harness, wallet *lnwallet bobCloseTx := lnwallet.CreateCooperativeCloseTx(fundingTxIn, chanInfo.RemoteBalance, chanInfo.LocalBalance, lnc.RemoteDeliveryScript, lnc.LocalDeliveryScript, - false) + true) bobSig, err := bobNode.signCommitTx(bobCloseTx, witnessScript, int64(lnc.Capacity)) if err != nil { t.Fatalf("unable to generate bob's signature for closing tx: %v", err)