github.com/decred/dcrlnd@v0.7.6/channeldb/migration_01_to_11/zpay32/hophint.go (about)

     1  package zpay32
     2  
     3  import "github.com/decred/dcrd/dcrec/secp256k1/v4"
     4  
     5  const (
     6  	// DefaultFinalCLTVDelta is the default value to be used as the final
     7  	// CLTV delta for a route if one is unspecified.
     8  	DefaultFinalCLTVDelta = 9
     9  )
    10  
    11  // HopHint is a routing hint that contains the minimum information of a channel
    12  // required for an intermediate hop in a route to forward the payment to the
    13  // next. This should be ideally used for private channels, since they are not
    14  // publicly advertised to the network for routing.
    15  type HopHint struct {
    16  	// NodeID is the public key of the node at the start of the channel.
    17  	NodeID *secp256k1.PublicKey
    18  
    19  	// ChannelID is the unique identifier of the channel.
    20  	ChannelID uint64
    21  
    22  	// FeeBaseMAtoms is the base fee of the channel in millisatoshis.
    23  	FeeBaseMAtoms uint32
    24  
    25  	// FeeProportionalMillionths is the fee rate, in millionths of a
    26  	// satoshi, for every satoshi sent through the channel.
    27  	FeeProportionalMillionths uint32
    28  
    29  	// CLTVExpiryDelta is the time-lock delta of the channel.
    30  	CLTVExpiryDelta uint16
    31  }
    32  
    33  // Copy returns a deep copy of the hop hint.
    34  func (h HopHint) Copy() HopHint {
    35  	nodeID := *h.NodeID
    36  	return HopHint{
    37  		NodeID:                    &nodeID,
    38  		ChannelID:                 h.ChannelID,
    39  		FeeBaseMAtoms:             h.FeeBaseMAtoms,
    40  		FeeProportionalMillionths: h.FeeProportionalMillionths,
    41  		CLTVExpiryDelta:           h.CLTVExpiryDelta,
    42  	}
    43  }