lnwallet: remove unused initiator param to CreateCooperativeCloseTx

This commit is contained in:
Johan T. Halseth 2020-01-06 11:42:02 +01:00
parent 2c46640dd0
commit f0019006a7
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26

@ -5910,10 +5910,11 @@ func (lc *LightningChannel) CreateCloseProposal(proposedFee btcutil.Amount,
theirBalance = theirBalance - proposedFee + commitFee theirBalance = theirBalance - proposedFee + commitFee
} }
closeTx := CreateCooperativeCloseTx(lc.fundingTxIn(), closeTx := CreateCooperativeCloseTx(
lc.localChanCfg.DustLimit, lc.remoteChanCfg.DustLimit, lc.fundingTxIn(), lc.localChanCfg.DustLimit,
ourBalance, theirBalance, localDeliveryScript, lc.remoteChanCfg.DustLimit, ourBalance, theirBalance,
remoteDeliveryScript, lc.channelState.IsInitiator) localDeliveryScript, remoteDeliveryScript,
)
// Ensure that the transaction doesn't explicitly violate any // Ensure that the transaction doesn't explicitly violate any
// consensus rules such as being too big, or having any value with a // 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 // Create the transaction used to return the current settled balance
// on this active channel back to both parties. In this current model, // on this active channel back to both parties. In this current model,
// the initiator pays full fees for the cooperative close transaction. // the initiator pays full fees for the cooperative close transaction.
closeTx := CreateCooperativeCloseTx(lc.fundingTxIn(), closeTx := CreateCooperativeCloseTx(
lc.localChanCfg.DustLimit, lc.remoteChanCfg.DustLimit, lc.fundingTxIn(), lc.localChanCfg.DustLimit,
ourBalance, theirBalance, localDeliveryScript, lc.remoteChanCfg.DustLimit, ourBalance, theirBalance,
remoteDeliveryScript, lc.channelState.IsInitiator) localDeliveryScript, remoteDeliveryScript,
)
// Ensure that the transaction doesn't explicitly validate any // Ensure that the transaction doesn't explicitly validate any
// consensus rules such as being too big, or having any value with a // 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. // transaction in full.
func CreateCooperativeCloseTx(fundingTxIn wire.TxIn, func CreateCooperativeCloseTx(fundingTxIn wire.TxIn,
localDust, remoteDust, ourBalance, theirBalance btcutil.Amount, localDust, remoteDust, ourBalance, theirBalance btcutil.Amount,
ourDeliveryScript, theirDeliveryScript []byte, ourDeliveryScript, theirDeliveryScript []byte) *wire.MsgTx {
initiator bool) *wire.MsgTx {
// Construct the transaction to perform a cooperative closure of the // Construct the transaction to perform a cooperative closure of the
// channel. In the event that one side doesn't have any settled funds // channel. In the event that one side doesn't have any settled funds