You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DRY the comparison blocks in update_claims_view_from_matched_txn
In `update_claims_view_from_matched_txn` we have two different
tx-equivalence checks which do the same thing - both check that the
tx which appeared on chain spent all of the outpoints which we
intended to spend in a given package. While one is more effecient
than the other (but only usable in a subset of cases), the
difference between O(N) and O(N^2) when N is 1-5 is trivial.
While it is possible we hit this code with just shy of 900 HTLC
outputs in a channel, we're still talking about only ~400k
inner iterations, and only in response to an on-chain transaction
which spends some inputs out from under us. Further, if we're
actually worried about the time complexity here (which we shouldn't
be), we can't just have one slow version and another that's fine -
we'd still need to worry about the slow version.
Here we simply drop the faster version, leaving the full-comparison
version in place and using it always.
0 commit comments