cnct: move supplement method into resolvers
This commit is contained in:
6 files changed
+76
-89
No files matched your search
@@ -8,6 +8,7 @@ import (
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/lightningnetwork/lnd/chainntnfs"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/input"
|
||||
"github.com/lightningnetwork/lnd/lntypes"
|
||||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
@@ -456,6 +457,21 @@ func newTimeoutResolverFromReader(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 *htlcTimeoutResolver) 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 *htlcTimeoutResolver) HtlcPoint() wire.OutPoint {
|
||||
return h.htlcResolution.HtlcPoint()
|
||||
}
|
||||
|
||||
// A compile time assertion to ensure htlcTimeoutResolver meets the
|
||||
// ContractResolver interface.
|
||||
var _ ContractResolver = (*htlcTimeoutResolver)(nil)
|
||||
var _ htlcContractResolver = (*htlcTimeoutResolver)(nil)
|
||||
Reference in new issue
Block a user