lnwallet: make fundingTxIn not depend on LightningWallet
This commit is contained in:
parent
83e0d47ba3
commit
13a108e578
@ -2233,8 +2233,8 @@ func (lc *LightningChannel) fetchCommitmentView(remoteChain bool,
|
||||
return c, nil
|
||||
}
|
||||
|
||||
func (lc *LightningChannel) fundingTxIn() wire.TxIn {
|
||||
return *wire.NewTxIn(&lc.channelState.FundingOutpoint, nil, nil)
|
||||
func fundingTxIn(chanState *channeldb.OpenChannel) wire.TxIn {
|
||||
return *wire.NewTxIn(&chanState.FundingOutpoint, nil, nil)
|
||||
}
|
||||
|
||||
// evaluateHTLCView processes all update entries in both HTLC update logs,
|
||||
@ -5530,7 +5530,7 @@ func (lc *LightningChannel) CreateCloseProposal(proposedFee btcutil.Amount,
|
||||
}
|
||||
|
||||
closeTx := CreateCooperativeCloseTx(
|
||||
lc.fundingTxIn(), lc.channelState.LocalChanCfg.DustLimit,
|
||||
fundingTxIn(lc.channelState), lc.channelState.LocalChanCfg.DustLimit,
|
||||
lc.channelState.RemoteChanCfg.DustLimit, ourBalance, theirBalance,
|
||||
localDeliveryScript, remoteDeliveryScript,
|
||||
)
|
||||
@ -5601,7 +5601,7 @@ func (lc *LightningChannel) CompleteCooperativeClose(localSig, remoteSig []byte,
|
||||
// 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.channelState.LocalChanCfg.DustLimit,
|
||||
fundingTxIn(lc.channelState), lc.channelState.LocalChanCfg.DustLimit,
|
||||
lc.channelState.RemoteChanCfg.DustLimit, ourBalance, theirBalance,
|
||||
localDeliveryScript, remoteDeliveryScript,
|
||||
)
|
||||
|
@ -213,13 +213,13 @@ func (lc *LightningChannel) createCommitmentTx(c *commitment,
|
||||
// out HTLCs.
|
||||
if c.isOurs {
|
||||
commitTx, err = CreateCommitTx(
|
||||
lc.fundingTxIn(), keyRing, &lc.channelState.LocalChanCfg,
|
||||
fundingTxIn(lc.channelState), keyRing, &lc.channelState.LocalChanCfg,
|
||||
&lc.channelState.RemoteChanCfg, ourBalance.ToSatoshis(),
|
||||
theirBalance.ToSatoshis(),
|
||||
)
|
||||
} else {
|
||||
commitTx, err = CreateCommitTx(
|
||||
lc.fundingTxIn(), keyRing, &lc.channelState.RemoteChanCfg,
|
||||
fundingTxIn(lc.channelState), keyRing, &lc.channelState.RemoteChanCfg,
|
||||
&lc.channelState.LocalChanCfg, theirBalance.ToSatoshis(),
|
||||
ourBalance.ToSatoshis(),
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user