channelnotifier

package
v0.9.2-beta-branch Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2020 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 btclog.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 btclog.

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 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

func New(chanDB *channeldb.DB) *ChannelNotifier

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) NotifyClosedChannelEvent

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

NotifyClosedChannelEvent notifies the channelEventNotifier goroutine that a channel has closed.

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) 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()

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 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.

Jump to

Keyboard shortcuts

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