@@ -98,12 +98,12 @@ func ComputeView(ourBalance, theirBalance uint64,
98
98
remoteHtlcIndex := make (map [uint64 ]lnwallet.AuxHtlcDescriptor )
99
99
100
100
for _ , entry := range original .Updates .Local {
101
- if entry .EntryType == lnwallet . Add {
101
+ if entry .IsAdd () {
102
102
localHtlcIndex [entry .HtlcIndex ] = entry
103
103
}
104
104
}
105
105
for _ , entry := range original .Updates .Remote {
106
- if entry .EntryType == lnwallet . Add {
106
+ if entry .IsAdd () {
107
107
remoteHtlcIndex [entry .HtlcIndex ] = entry
108
108
}
109
109
}
@@ -115,6 +115,13 @@ func ComputeView(ourBalance, theirBalance uint64,
115
115
case lnwallet .Add :
116
116
continue
117
117
118
+ // Skip noop adds, they will also be processed below. This type
119
+ // of entry only settles the assets and not the sats that carry
120
+ // them. This is not something we have to worry about here since
121
+ // we only care about the assets at this point.
122
+ case lnwallet .NoOpAdd :
123
+ continue
124
+
118
125
// Fee updates don't concern us at the asset level.
119
126
case lnwallet .FeeUpdate :
120
127
continue
@@ -162,6 +169,13 @@ func ComputeView(ourBalance, theirBalance uint64,
162
169
case lnwallet .Add :
163
170
continue
164
171
172
+ // Skip noop adds, they will also be processed below. This type
173
+ // of entry only settles the assets and not the sats that carry
174
+ // them. This is not something we have to worry about here since
175
+ // we only care about the assets at this point.
176
+ case lnwallet .NoOpAdd :
177
+ continue
178
+
165
179
// Fee updates don't concern us at the asset level.
166
180
case lnwallet .FeeUpdate :
167
181
continue
@@ -207,7 +221,7 @@ func ComputeView(ourBalance, theirBalance uint64,
207
221
// settled HTLCs, and debiting the chain state balance due to any newly
208
222
// added HTLCs.
209
223
for _ , entry := range original .Updates .Local {
210
- isAdd := entry .EntryType == lnwallet . Add
224
+ isAdd := entry .IsAdd ()
211
225
212
226
// Skip any entries that aren't adds or adds that were already
213
227
// settled or failed by a child HTLC entry we processed above.
@@ -249,7 +263,7 @@ func ComputeView(ourBalance, theirBalance uint64,
249
263
newView .OurUpdates = append (newView .OurUpdates , decodedEntry )
250
264
}
251
265
for _ , entry := range original .Updates .Remote {
252
- isAdd := entry .EntryType == lnwallet . Add
266
+ isAdd := entry .IsAdd ()
253
267
254
268
// Skip any entries that aren't adds or adds that were already
255
269
// settled or failed by a child HTLC entry we processed above.
0 commit comments