Skip to content

Commit 112cca1

Browse files
Roasbeefguggero
authored andcommitted
contractcourt: pause resolution for HTLCs w/ custom records
This is a hold over until the aux resolution is finalized for HTLC outputs.
1 parent c38544b commit 112cca1

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

contractcourt/htlc_incoming_contest_resolver.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,14 @@ func (h *htlcIncomingContestResolver) Resolve(
9999
return nil, nil
100100
}
101101

102+
// If the HTLC has custom records, then for now we'll pause resolution.
103+
if len(h.htlc.CustomRecords) != 0 {
104+
select { //nolint:gosimple
105+
case <-h.quit:
106+
return nil, errResolverShuttingDown
107+
}
108+
}
109+
102110
// First try to parse the payload. If that fails, we can stop resolution
103111
// now.
104112
payload, nextHopOnionBlob, err := h.decodePayload()

contractcourt/htlc_outgoing_contest_resolver.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ func (h *htlcOutgoingContestResolver) Resolve(
5858
return nil, nil
5959
}
6060

61+
// If the HTLC has custom records, then for now we'll pause resolution.
62+
if len(h.htlc.CustomRecords) != 0 {
63+
select { //nolint:gosimple
64+
case <-h.quit:
65+
return nil, errResolverShuttingDown
66+
}
67+
}
68+
6169
// Otherwise, we'll watch for two external signals to decide if we'll
6270
// morph into another resolver, or fully resolve the contract.
6371
//

contractcourt/htlc_success_resolver.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,14 @@ func (h *htlcSuccessResolver) Resolve(
123123
return nil, nil
124124
}
125125

126+
// If the HTLC has custom records, then for now we'll pause resolution.
127+
if len(h.htlc.CustomRecords) != 0 {
128+
select { //nolint:gosimple
129+
case <-h.quit:
130+
return nil, errResolverShuttingDown
131+
}
132+
}
133+
126134
// If we don't have a success transaction, then this means that this is
127135
// an output on the remote party's commitment transaction.
128136
if h.htlcResolution.SignedSuccessTx == nil {

contractcourt/htlc_timeout_resolver.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,14 @@ func (h *htlcTimeoutResolver) Resolve(
426426
return nil, nil
427427
}
428428

429+
// If the HTLC has custom records, then for now we'll pause resolution.
430+
if len(h.htlc.CustomRecords) != 0 {
431+
select { //nolint:gosimple
432+
case <-h.quit:
433+
return nil, errResolverShuttingDown
434+
}
435+
}
436+
429437
// Start by spending the HTLC output, either by broadcasting the
430438
// second-level timeout transaction, or directly if this is the remote
431439
// commitment.

0 commit comments

Comments
 (0)