contractcourt: unify the lease specific HTLC sweeping logic

In this commit, we consolidate the _lease specific_ logic for the
success and timeout HTLC resolvers. We do this with the addition of a
new struct which is then composed via struct embedding with the two
existing structs. This fixes a flake in the integration tests by
ensuring the height is set up front, rather than eventually once the
height matches the lock time.
This commit is contained in:
Olaoluwa Osuntokun committed 2022-06-01 16:42:33 -07:00
1 parent 199f9d1139
commit 9b0718ae35
7 files changed
+127 -95

No files matched your search

@@ -190,14 +190,6 @@ func (h *htlcOutgoingContestResolver) IsResolved() bool {
return h.resolved
}
// SupplementState allows the user of a ContractResolver to supplement it with
// state required for the proper resolution of a contract.
//
// NOTE: Part of the ContractResolver interface.
func (h *htlcOutgoingContestResolver) SupplementState(state *channeldb.OpenChannel) {
h.htlcTimeoutResolver.SupplementState(state)
}
// Encode writes an encoded version of the ContractResolver into the passed
// Writer.
//