mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-29 07:00:55 +02:00
multi: create channeldb/models package
Add a new subpackage to `lnd/channeldb` to hold some of the types that are used in the package itself and in other packages that should not depend on `channeldb`.
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/channeldb/models"
|
||||
"github.com/lightningnetwork/lnd/htlcswitch/hop"
|
||||
"github.com/lightningnetwork/lnd/lntypes"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
@@ -108,10 +109,10 @@ func (h *HtlcNotifier) SubscribeHtlcEvents() (*subscribe.Client, error) {
|
||||
// HtlcKey uniquely identifies the htlc.
|
||||
type HtlcKey struct {
|
||||
// IncomingCircuit is the channel an htlc id of the incoming htlc.
|
||||
IncomingCircuit channeldb.CircuitKey
|
||||
IncomingCircuit models.CircuitKey
|
||||
|
||||
// OutgoingCircuit is the channel and htlc id of the outgoing htlc.
|
||||
OutgoingCircuit channeldb.CircuitKey
|
||||
OutgoingCircuit models.CircuitKey
|
||||
}
|
||||
|
||||
// String returns a string representation of a htlc key.
|
||||
@@ -398,7 +399,7 @@ func (h *HtlcNotifier) NotifySettleEvent(key HtlcKey,
|
||||
// htlc has been determined.
|
||||
//
|
||||
// Note this is part of the htlcNotifier interface.
|
||||
func (h *HtlcNotifier) NotifyFinalHtlcEvent(key channeldb.CircuitKey,
|
||||
func (h *HtlcNotifier) NotifyFinalHtlcEvent(key models.CircuitKey,
|
||||
info channeldb.FinalHtlcInfo) {
|
||||
|
||||
event := &FinalHtlcEvent{
|
||||
@@ -423,7 +424,7 @@ func (h *HtlcNotifier) NotifyFinalHtlcEvent(key channeldb.CircuitKey,
|
||||
// originate at our node.
|
||||
func newHtlcKey(pkt *htlcPacket) HtlcKey {
|
||||
htlcKey := HtlcKey{
|
||||
IncomingCircuit: channeldb.CircuitKey{
|
||||
IncomingCircuit: models.CircuitKey{
|
||||
ChanID: pkt.incomingChanID,
|
||||
HtlcID: pkt.incomingHTLCID,
|
||||
},
|
||||
|
Reference in New Issue
Block a user