From f0019006a7ae7b94e2e462be2d6fa9dceeaf6c1d Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Mon, 6 Jan 2020 11:42:02 +0100 Subject: [PATCH] lnwallet: remove unused initiator param to CreateCooperativeCloseTx --- lnwallet/channel.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lnwallet/channel.go b/lnwallet/channel.go index 8f728283..b4bbe7f6 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -5910,10 +5910,11 @@ func (lc *LightningChannel) CreateCloseProposal(proposedFee btcutil.Amount, theirBalance = theirBalance - proposedFee + commitFee } - closeTx := CreateCooperativeCloseTx(lc.fundingTxIn(), - lc.localChanCfg.DustLimit, lc.remoteChanCfg.DustLimit, - ourBalance, theirBalance, localDeliveryScript, - remoteDeliveryScript, lc.channelState.IsInitiator) + closeTx := CreateCooperativeCloseTx( + lc.fundingTxIn(), lc.localChanCfg.DustLimit, + lc.remoteChanCfg.DustLimit, ourBalance, theirBalance, + localDeliveryScript, remoteDeliveryScript, + ) // Ensure that the transaction doesn't explicitly violate any // consensus rules such as being too big, or having any value with a @@ -5980,10 +5981,11 @@ func (lc *LightningChannel) CompleteCooperativeClose(localSig, remoteSig []byte, // Create the transaction used to return the current settled balance // on this active channel back to both parties. In this current model, // the initiator pays full fees for the cooperative close transaction. - closeTx := CreateCooperativeCloseTx(lc.fundingTxIn(), - lc.localChanCfg.DustLimit, lc.remoteChanCfg.DustLimit, - ourBalance, theirBalance, localDeliveryScript, - remoteDeliveryScript, lc.channelState.IsInitiator) + closeTx := CreateCooperativeCloseTx( + lc.fundingTxIn(), lc.localChanCfg.DustLimit, + lc.remoteChanCfg.DustLimit, ourBalance, theirBalance, + localDeliveryScript, remoteDeliveryScript, + ) // Ensure that the transaction doesn't explicitly validate any // consensus rules such as being too big, or having any value with a @@ -6272,8 +6274,7 @@ func CreateCommitTx(fundingOutput wire.TxIn, // transaction in full. func CreateCooperativeCloseTx(fundingTxIn wire.TxIn, localDust, remoteDust, ourBalance, theirBalance btcutil.Amount, - ourDeliveryScript, theirDeliveryScript []byte, - initiator bool) *wire.MsgTx { + ourDeliveryScript, theirDeliveryScript []byte) *wire.MsgTx { // Construct the transaction to perform a cooperative closure of the // channel. In the event that one side doesn't have any settled funds