mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-25 21:46:44 +02:00
contractcourt: pause resolution for HTLCs w/ custom records
This is a hold over until the aux resolution is finalized for HTLC outputs.
This commit is contained in:
committed by
Oliver Gugger
parent
a21fb1b69c
commit
678028cee9
@@ -99,6 +99,17 @@ func (h *htlcIncomingContestResolver) Resolve(
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the HTLC has custom records, then for now we'll pause resolution.
|
||||||
|
//
|
||||||
|
// TODO(roasbeef): Implement resolving HTLCs with custom records
|
||||||
|
// (follow-up PR).
|
||||||
|
if len(h.htlc.CustomRecords) != 0 {
|
||||||
|
select { //nolint:gosimple
|
||||||
|
case <-h.quit:
|
||||||
|
return nil, errResolverShuttingDown
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// First try to parse the payload. If that fails, we can stop resolution
|
// First try to parse the payload. If that fails, we can stop resolution
|
||||||
// now.
|
// now.
|
||||||
payload, nextHopOnionBlob, err := h.decodePayload()
|
payload, nextHopOnionBlob, err := h.decodePayload()
|
||||||
|
@@ -58,6 +58,17 @@ func (h *htlcOutgoingContestResolver) Resolve(
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the HTLC has custom records, then for now we'll pause resolution.
|
||||||
|
//
|
||||||
|
// TODO(roasbeef): Implement resolving HTLCs with custom records
|
||||||
|
// (follow-up PR).
|
||||||
|
if len(h.htlc.CustomRecords) != 0 {
|
||||||
|
select { //nolint:gosimple
|
||||||
|
case <-h.quit:
|
||||||
|
return nil, errResolverShuttingDown
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Otherwise, we'll watch for two external signals to decide if we'll
|
// Otherwise, we'll watch for two external signals to decide if we'll
|
||||||
// morph into another resolver, or fully resolve the contract.
|
// morph into another resolver, or fully resolve the contract.
|
||||||
//
|
//
|
||||||
|
@@ -123,6 +123,17 @@ func (h *htlcSuccessResolver) Resolve(
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the HTLC has custom records, then for now we'll pause resolution.
|
||||||
|
//
|
||||||
|
// TODO(roasbeef): Implement resolving HTLCs with custom records
|
||||||
|
// (follow-up PR).
|
||||||
|
if len(h.htlc.CustomRecords) != 0 {
|
||||||
|
select { //nolint:gosimple
|
||||||
|
case <-h.quit:
|
||||||
|
return nil, errResolverShuttingDown
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If we don't have a success transaction, then this means that this is
|
// If we don't have a success transaction, then this means that this is
|
||||||
// an output on the remote party's commitment transaction.
|
// an output on the remote party's commitment transaction.
|
||||||
if h.htlcResolution.SignedSuccessTx == nil {
|
if h.htlcResolution.SignedSuccessTx == nil {
|
||||||
|
@@ -426,6 +426,17 @@ func (h *htlcTimeoutResolver) Resolve(
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the HTLC has custom records, then for now we'll pause resolution.
|
||||||
|
//
|
||||||
|
// TODO(roasbeef): Implement resolving HTLCs with custom records
|
||||||
|
// (follow-up PR).
|
||||||
|
if len(h.htlc.CustomRecords) != 0 {
|
||||||
|
select { //nolint:gosimple
|
||||||
|
case <-h.quit:
|
||||||
|
return nil, errResolverShuttingDown
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Start by spending the HTLC output, either by broadcasting the
|
// Start by spending the HTLC output, either by broadcasting the
|
||||||
// second-level timeout transaction, or directly if this is the remote
|
// second-level timeout transaction, or directly if this is the remote
|
||||||
// commitment.
|
// commitment.
|
||||||
|
Reference in New Issue
Block a user