Merge pull request #8952 from ProofOfKeags/refactor/lnwallet-channel-typed-list

[MICRO]: lnwallet: refactor channel to use new typed List
This commit is contained in:
Oliver Gugger authored and GitHub committed 2024-08-05 02:07:50 -06:00
commit 6e63dcd6f9
4 files changed
+37 -38

No files matched your search

+8 -8
View File
@@ -2483,7 +2483,7 @@ type htlcView struct {
func (lc *LightningChannel) fetchHTLCView(theirLogIndex, ourLogIndex uint64) *htlcView {
var ourHTLCs []*PaymentDescriptor
for e := lc.localUpdateLog.Front(); e != nil; e = e.Next() {
htlc := e.Value.(*PaymentDescriptor)
htlc := e.Value
// This HTLC is active from this point-of-view iff the log
// index of the state update is below the specified index in
@@ -2495,7 +2495,7 @@ func (lc *LightningChannel) fetchHTLCView(theirLogIndex, ourLogIndex uint64) *ht
var theirHTLCs []*PaymentDescriptor
for e := lc.remoteUpdateLog.Front(); e != nil; e = e.Next() {
htlc := e.Value.(*PaymentDescriptor)
htlc := e.Value
// If this is an incoming HTLC, then it is only active from
// this point-of-view if the index of the HTLC addition in
@@ -3139,7 +3139,7 @@ func (lc *LightningChannel) createCommitDiff(
// set of items we need to retransmit if we reconnect and find that
// they didn't process this new state fully.
for e := lc.localUpdateLog.Front(); e != nil; e = e.Next() {
pd := e.Value.(*PaymentDescriptor)
pd := e.Value
// If this entry wasn't committed at the exact height of this
// remote commitment, then we'll skip it as it was already
@@ -3277,7 +3277,7 @@ func (lc *LightningChannel) getUnsignedAckedUpdates() []channeldb.LogUpdate {
// remote party expects.
var logUpdates []channeldb.LogUpdate
for e := lc.remoteUpdateLog.Front(); e != nil; e = e.Next() {
pd := e.Value.(*PaymentDescriptor)
pd := e.Value
// Skip all remote updates that we have already included in our
// commit chain.
@@ -5225,7 +5225,7 @@ func (lc *LightningChannel) ReceiveRevocation(revMsg *lnwire.RevokeAndAck) (
var addIndex, settleFailIndex uint16
for e := lc.remoteUpdateLog.Front(); e != nil; e = e.Next() {
pd := e.Value.(*PaymentDescriptor)
pd := e.Value
// Fee updates are local to this particular channel, and should
// never be forwarded.
@@ -5555,7 +5555,7 @@ func (lc *LightningChannel) GetDustSum(whoseCommit lntypes.ChannelParty,
// Grab all of our HTLCs and evaluate against the dust limit.
for e := lc.localUpdateLog.Front(); e != nil; e = e.Next() {
pd := e.Value.(*PaymentDescriptor)
pd := e.Value
if pd.EntryType != Add {
continue
}
@@ -5574,7 +5574,7 @@ func (lc *LightningChannel) GetDustSum(whoseCommit lntypes.ChannelParty,
// Grab all of their HTLCs and evaluate against the dust limit.
for e := lc.remoteUpdateLog.Front(); e != nil; e = e.Next() {
pd := e.Value.(*PaymentDescriptor)
pd := e.Value
if pd.EntryType != Add {
continue
}
@@ -8579,7 +8579,7 @@ func (lc *LightningChannel) unsignedLocalUpdates(remoteMessageIndex,
var localPeerUpdates []channeldb.LogUpdate
for e := lc.localUpdateLog.Front(); e != nil; e = e.Next() {
pd := e.Value.(*PaymentDescriptor)
pd := e.Value
// We don't save add updates as they are restored from the
// remote commitment in restoreStateLogs.