contractcourt+lnd: make IncubateOutputs take fn.Option

`IncubateOutputs` never takes more than one HTLC, so we change the
params to be optional, which helps with the following commit where we
pass the deadline height when incubating outgoing HTLCs.
This commit is contained in:
yyforyongyu committed 2024-04-19 21:33:34 +08:00
1 parent 6f0c2b5bab
commit 33abbe1942
9 files changed
+44 -40

No files matched your search

+4 -3
View File
@@ -114,14 +114,15 @@ type ChainArbitratorConfig struct {
// returned.
IsOurAddress func(btcutil.Address) bool
// IncubateOutput sends either an incoming HTLC, an outgoing HTLC, or
// IncubateOutputs sends either an incoming HTLC, an outgoing HTLC, or
// both to the utxo nursery. Once this function returns, the nursery
// should have safely persisted the outputs to disk, and should start
// the process of incubation. This is used when a resolver wishes to
// pass off the output to the nursery as we're only waiting on an
// absolute/relative item block.
IncubateOutputs func(wire.OutPoint, *lnwallet.OutgoingHtlcResolution,
*lnwallet.IncomingHtlcResolution, uint32) error
IncubateOutputs func(wire.OutPoint,
fn.Option[lnwallet.OutgoingHtlcResolution],
fn.Option[lnwallet.IncomingHtlcResolution], uint32) error
// PreimageDB is a global store of all known pre-images. We'll use this
// to decide if we should broadcast a commitment transaction to claim