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 committed 2024-07-31 14:50:26 -07:00
1 parent 33934449ac
commit 0996e4f163
10 files changed
+409 -361

No files matched your search

+8 -3
View File
@@ -2730,7 +2730,12 @@ func (l *channelLink) MayAddOutgoingHtlc(amt lnwire.MilliSatoshi) error {
func (l *channelLink) getDustSum(remote bool,
dryRunFee fn.Option[chainfee.SatPerKWeight]) lnwire.MilliSatoshi {
return l.channel.GetDustSum(remote, dryRunFee)
party := lntypes.Local
if remote {
party = lntypes.Remote
}
return l.channel.GetDustSum(party, dryRunFee)
}
// getFeeRate is a wrapper method that retrieves the underlying channel's
@@ -2893,13 +2898,13 @@ func dustHelper(chantype channeldb.ChannelType, localDustLimit,
if localCommit {
return lnwallet.HtlcIsDust(
chantype, incoming, true, feerate, amt,
chantype, incoming, lntypes.Local, feerate, amt,
localDustLimit,
)
}
return lnwallet.HtlcIsDust(
chantype, incoming, false, feerate, amt,
chantype, incoming, lntypes.Remote, feerate, amt,
remoteDustLimit,
)
}