multi: refactor lnwallet/channel.go to use ChannelParty in select places

We also include changes to contractcourt, htlcswitch and peer to stitch the
boundaries together.
This commit is contained in:
Keagan McClelland
2024-07-30 16:44:18 -07:00
parent 33934449ac
commit 0996e4f163
10 changed files with 409 additions and 361 deletions

View File

@@ -20,6 +20,7 @@ import (
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/fn"
"github.com/lightningnetwork/lnd/input"
"github.com/lightningnetwork/lnd/lntypes"
"github.com/lightningnetwork/lnd/lnutils"
"github.com/lightningnetwork/lnd/lnwallet"
"github.com/lightningnetwork/lnd/lnwire"
@@ -418,7 +419,7 @@ func (c *chainWatcher) handleUnknownLocalState(
// and remote keys for this state. We use our point as only we can
// revoke our own commitment.
commitKeyRing := lnwallet.DeriveCommitmentKeys(
commitPoint, true, c.cfg.chanState.ChanType,
commitPoint, lntypes.Local, c.cfg.chanState.ChanType,
&c.cfg.chanState.LocalChanCfg, &c.cfg.chanState.RemoteChanCfg,
)
@@ -891,7 +892,7 @@ func (c *chainWatcher) handlePossibleBreach(commitSpend *chainntnfs.SpendDetail,
// Create an AnchorResolution for the breached state.
anchorRes, err := lnwallet.NewAnchorResolution(
c.cfg.chanState, commitSpend.SpendingTx, retribution.KeyRing,
false,
lntypes.Remote,
)
if err != nil {
return false, fmt.Errorf("unable to create anchor "+