lnwallet/chancloser: add aux chan closer, use in coop flow

This commit is contained in:
Olaoluwa Osuntokun
2024-05-29 19:57:42 +02:00
committed by Oliver Gugger
parent e2dae56698
commit e536cfad0f
4 changed files with 269 additions and 17 deletions

View File

@@ -22,6 +22,7 @@ import (
"github.com/lightningnetwork/lnd/lnwallet"
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/lightningnetwork/lnd/tlv"
"github.com/stretchr/testify/require"
)
@@ -152,6 +153,14 @@ func (m *mockChannel) ChannelPoint() wire.OutPoint {
return m.chanPoint
}
func (m *mockChannel) LocalCommitmentBlob() fn.Option[tlv.Blob] {
return fn.None[tlv.Blob]()
}
func (m *mockChannel) FundingBlob() fn.Option[tlv.Blob] {
return fn.None[tlv.Blob]()
}
func (m *mockChannel) MarkCoopBroadcasted(*wire.MsgTx,
lntypes.ChannelParty) error {
@@ -205,12 +214,20 @@ func (m *mockChannel) CompleteCooperativeClose(localSig,
return &wire.MsgTx{}, 0, nil
}
func (m *mockChannel) LocalBalanceDust() bool {
return false
func (m *mockChannel) LocalBalanceDust() (bool, btcutil.Amount) {
return false, 0
}
func (m *mockChannel) RemoteBalanceDust() bool {
return false
func (m *mockChannel) RemoteBalanceDust() (bool, btcutil.Amount) {
return false, 0
}
func (m *mockChannel) CommitBalances() (btcutil.Amount, btcutil.Amount) {
return 0, 0
}
func (m *mockChannel) CommitFee() btcutil.Amount {
return 0
}
func (m *mockChannel) ChanType() channeldb.ChannelType {