tapfeatures

package
v0.7.0-rc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NoOpHTLCsRequired is a feature bit that declares the noop-htlcs as a
	// required feature.
	NoOpHTLCsRequired lnwire.FeatureBit = 0

	// NoOpHTLCsOptional is a feature bit that declares the noop-htlcs as an
	// optional feature.
	NoOpHTLCsOptional lnwire.FeatureBit = 1

	// STXORequired is a feature bit that declares STXO proofs as a required
	// feature.
	STXORequired lnwire.FeatureBit = 2

	// STXOOptional is a feature bit that declares the STXO proofs as an
	// optional feature.
	STXOOptional lnwire.FeatureBit = 3
)
View Source
const (
	// AuxFeatureBitsTLV is the TLV type used to encode auxiliary feature
	// bits in the init message. These feature bits allow aux channel
	// implementations to negotiate custom channel behavior.
	AuxFeatureBitsTLV tlv.Type = 65545
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuxChannelNegotiator

type AuxChannelNegotiator struct {
	// contains filtered or unexported fields
}

AuxChannelNegotiator is responsible for producing the extra tlv blob that is encapsulated in the init and reestablish peer messages. This helps us communicate custom feature bits with our peer.

func NewAuxChannelNegotiator

func NewAuxChannelNegotiator() *AuxChannelNegotiator

NewAuxChannelNegotiator returns a new instance of the aux channel negotiator.

func (*AuxChannelNegotiator) GetChannelFeatures

func (n *AuxChannelNegotiator) GetChannelFeatures(
	cid lnwire.ChannelID) lnwire.FeatureVector

GetChannelFeatures returns the negotiated feature bits vector for the channel identified by the given channelID.

func (*AuxChannelNegotiator) GetInitRecords

func (n *AuxChannelNegotiator) GetInitRecords(
	_ route.Vertex) (lnwire.CustomRecords, error)

GetInitRecords is called when sending an init message to a peer. It returns custom feature bits to include in the init message TLVs. The implementation can decide which features to advertise based on the peer's identity.

func (*AuxChannelNegotiator) GetPeerFeatures

func (n *AuxChannelNegotiator) GetPeerFeatures(
	peer route.Vertex) lnwire.FeatureVector

GetPeerFeatures returns the negotiated feature bit vector that was established with the given peer.

func (*AuxChannelNegotiator) ProcessChannelReady

func (n *AuxChannelNegotiator) ProcessChannelReady(cid lnwire.ChannelID,
	peer route.Vertex)

ProcessChannelReady handles the reception of the ChannelReady message, which signals that a newly established channel is now ready to use. This helps us correlate a peer's features with a channel outpoint

func (*AuxChannelNegotiator) ProcessInitRecords

func (n *AuxChannelNegotiator) ProcessInitRecords(peer route.Vertex,
	customRecords lnwire.CustomRecords) error

ProcessInitRecords handles received init feature TLVs from a peer. The implementation can store state internally to affect future channel operations with this peer.

func (*AuxChannelNegotiator) ProcessReestablish

func (n *AuxChannelNegotiator) ProcessReestablish(
	cid lnwire.ChannelID, peer route.Vertex)

ProcessReestablish handles the reception of the ChannelReestablish message, which signals that a previously established channel is now ready to use. This helps us correlate a peer's features with a channel outpoint.

type AuxFeatureBits

type AuxFeatureBits = tlv.Blob

AuxFeatureBits is a type alias for a TLV blob that contains custom feature bits for auxiliary channel negotiation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL