mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 18:10:34 +01:00
7dfe4018ce
This commit was previously split into the following parts to ease review: - 2d746f68: replace imports - 4008f0fd: use ecdsa.Signature - 849e33d1: remove btcec.S256() - b8f6ebbd: use v2 library correctly - fa80bca9: bump go modules
45 lines
1.4 KiB
Go
45 lines
1.4 KiB
Go
package zpay32
|
|
|
|
import "github.com/btcsuite/btcd/btcec/v2"
|
|
|
|
const (
|
|
// DefaultAssumedFinalCLTVDelta is the default value to be used as the
|
|
// final CLTV delta for a route if one is unspecified in the payment
|
|
// request.
|
|
DefaultAssumedFinalCLTVDelta = 9
|
|
)
|
|
|
|
// HopHint is a routing hint that contains the minimum information of a channel
|
|
// required for an intermediate hop in a route to forward the payment to the
|
|
// next. This should be ideally used for private channels, since they are not
|
|
// publicly advertised to the network for routing.
|
|
type HopHint struct {
|
|
// NodeID is the public key of the node at the start of the channel.
|
|
NodeID *btcec.PublicKey
|
|
|
|
// ChannelID is the unique identifier of the channel.
|
|
ChannelID uint64
|
|
|
|
// FeeBaseMSat is the base fee of the channel in millisatoshis.
|
|
FeeBaseMSat uint32
|
|
|
|
// FeeProportionalMillionths is the fee rate, in millionths of a
|
|
// satoshi, for every satoshi sent through the channel.
|
|
FeeProportionalMillionths uint32
|
|
|
|
// CLTVExpiryDelta is the time-lock delta of the channel.
|
|
CLTVExpiryDelta uint16
|
|
}
|
|
|
|
// Copy returns a deep copy of the hop hint.
|
|
func (h HopHint) Copy() HopHint {
|
|
nodeID := *h.NodeID
|
|
return HopHint{
|
|
NodeID: &nodeID,
|
|
ChannelID: h.ChannelID,
|
|
FeeBaseMSat: h.FeeBaseMSat,
|
|
FeeProportionalMillionths: h.FeeProportionalMillionths,
|
|
CLTVExpiryDelta: h.CLTVExpiryDelta,
|
|
}
|
|
}
|