mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-31 08:02:25 +02:00
cnct: move supplement method into resolvers
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/input"
|
||||
"github.com/lightningnetwork/lnd/lntypes"
|
||||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
@@ -338,6 +339,21 @@ func newSuccessResolverFromReader(r io.Reader, resCfg ResolverConfig) (
|
||||
return h, nil
|
||||
}
|
||||
|
||||
// Supplement adds additional information to the resolver that is required
|
||||
// before Resolve() is called.
|
||||
//
|
||||
// NOTE: Part of the htlcContractResolver interface.
|
||||
func (h *htlcSuccessResolver) Supplement(htlc channeldb.HTLC) {
|
||||
h.htlcAmt = htlc.Amt
|
||||
}
|
||||
|
||||
// HtlcPoint returns the htlc's outpoint on the commitment tx.
|
||||
//
|
||||
// NOTE: Part of the htlcContractResolver interface.
|
||||
func (h *htlcSuccessResolver) HtlcPoint() wire.OutPoint {
|
||||
return h.htlcResolution.HtlcPoint()
|
||||
}
|
||||
|
||||
// A compile time assertion to ensure htlcSuccessResolver meets the
|
||||
// ContractResolver interface.
|
||||
var _ ContractResolver = (*htlcSuccessResolver)(nil)
|
||||
var _ htlcContractResolver = (*htlcSuccessResolver)(nil)
|
||||
|
Reference in New Issue
Block a user