channelnotifier

package
v0.0.0-...-0c21b66 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.

func UseLogger

func UseLogger(logger bronlog.Logger)

UseLogger uses a specified Logger to output package logging info. This should be used in preference to SetLogWriter if the caller is also using bronlog.

Types

type ActiveChannelEvent

type ActiveChannelEvent struct {
	// ChannelPoint is the channelpoint for the newly active channel.
	ChannelPoint *wire.OutPoint
}

ActiveChannelEvent represents a new event where a channel becomes active.

type ActiveLinkEvent

type ActiveLinkEvent struct {
	// ChannelPoint is the channel point for the newly active channel.
	ChannelPoint *wire.OutPoint
}

ActiveLinkEvent represents a new event where the link becomes active in the switch. This happens before the ActiveChannelEvent.

type ChannelNotifier

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

ChannelNotifier is a subsystem which all active, inactive, and closed channel events pipe through. It takes subscriptions for its events, and whenever it receives a new event it notifies its subscribers over the proper channel.

func New

New creates a new channel notifier. The ChannelNotifier gets channel events from peers and from the chain arbitrator, and dispatches them to its clients.

func (*ChannelNotifier) NotifyActiveChannelEvent

func (c *ChannelNotifier) NotifyActiveChannelEvent(chanPoint wire.OutPoint)

NotifyActiveChannelEvent notifies the channelEventNotifier goroutine that a channel is active.

func (*ChannelNotifier) NotifyActiveLinkEvent

func (c *ChannelNotifier) NotifyActiveLinkEvent(chanPoint wire.OutPoint)

NotifyActiveLinkEvent notifies the channelEventNotifier goroutine that a link has been added to the switch.

func (*ChannelNotifier) NotifyClosedChannelEvent

func (c *ChannelNotifier) NotifyClosedChannelEvent(chanPoint wire.OutPoint)

NotifyClosedChannelEvent notifies the channelEventNotifier goroutine that a channel has closed.

func (*ChannelNotifier) NotifyFullyResolvedChannelEvent

func (c *ChannelNotifier) NotifyFullyResolvedChannelEvent(
	chanPoint wire.OutPoint)

NotifyFullyResolvedChannelEvent notifies the channelEventNotifier goroutine that a channel was fully resolved on chain.

func (*ChannelNotifier) NotifyInactiveChannelEvent

func (c *ChannelNotifier) NotifyInactiveChannelEvent(chanPoint wire.OutPoint)

NotifyInactiveChannelEvent notifies the channelEventNotifier goroutine that a channel is inactive.

func (*ChannelNotifier) NotifyOpenChannelEvent

func (c *ChannelNotifier) NotifyOpenChannelEvent(chanPoint wire.OutPoint)

NotifyOpenChannelEvent notifies the channelEventNotifier goroutine that a channel has gone from pending open to open.

func (*ChannelNotifier) NotifyPendingOpenChannelEvent

func (c *ChannelNotifier) NotifyPendingOpenChannelEvent(chanPoint wire.OutPoint,
	pendingChan *channeldb.OpenChannel)

NotifyPendingOpenChannelEvent notifies the channelEventNotifier goroutine that a new channel is pending. The pending channel is passed as a parameter instead of read from the database because it might not yet have been persisted to the DB because we still wait for the final message from the remote peer.

func (*ChannelNotifier) Start

func (c *ChannelNotifier) Start() error

Start starts the ChannelNotifier and all goroutines it needs to carry out its task.

func (*ChannelNotifier) Stop

func (c *ChannelNotifier) Stop() error

Stop signals the notifier for a graceful shutdown.

func (*ChannelNotifier) SubscribeChannelEvents

func (c *ChannelNotifier) SubscribeChannelEvents() (*subscribe.Client, error)

SubscribeChannelEvents returns a subscribe.Client that will receive updates any time the Server is made aware of a new event. The subscription provides channel events from the point of subscription onwards.

TODO(carlaKC): update to allow subscriptions to specify a block height from which we would like to subscribe to events.

type ClosedChannelEvent

type ClosedChannelEvent struct {
	// CloseSummary is the summary of the channel close that has occurred.
	CloseSummary *channeldb.ChannelCloseSummary
}

ClosedChannelEvent represents a new event where a channel becomes closed.

type FullyResolvedChannelEvent

type FullyResolvedChannelEvent struct {
	// ChannelPoint is the channelpoint for the newly fully resolved
	// channel.
	ChannelPoint *wire.OutPoint
}

FullyResolvedChannelEvent represents a new event where a channel becomes fully resolved.

type InactiveChannelEvent

type InactiveChannelEvent struct {
	// ChannelPoint is the channelpoint for the newly inactive channel.
	ChannelPoint *wire.OutPoint
}

InactiveChannelEvent represents a new event where a channel becomes inactive.

type OpenChannelEvent

type OpenChannelEvent struct {
	// Channel is the channel that has become open.
	Channel *channeldb.OpenChannel
}

OpenChannelEvent represents a new event where a channel goes from pending open to open.

type PendingOpenChannelEvent

type PendingOpenChannelEvent struct {
	// ChannelPoint is the channel outpoint for the new channel.
	ChannelPoint *wire.OutPoint

	// PendingChannel is the channel configuration for the newly created
	// channel. This might not have been persisted to the channel DB yet
	// because we are still waiting for the final message from the remote
	// peer.
	PendingChannel *channeldb.OpenChannel
}

PendingOpenChannelEvent represents a new event where a new channel has entered a pending open state.

Jump to

Keyboard shortcuts

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