chanacceptor

package
v0.9.0-beta Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainedAcceptor

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

ChainedAcceptor represents a conjunction of ChannelAcceptor results.

func NewChainedAcceptor

func NewChainedAcceptor() *ChainedAcceptor

NewChainedAcceptor initializes a ChainedAcceptor.

func (*ChainedAcceptor) Accept

func (c *ChainedAcceptor) Accept(req *ChannelAcceptRequest) bool

Accept evaluates the results of all ChannelAcceptors in the acceptors map and returns the conjunction of all these predicates.

NOTE: Part of the ChannelAcceptor interface.

func (*ChainedAcceptor) AddAcceptor

func (c *ChainedAcceptor) AddAcceptor(acceptor ChannelAcceptor) uint64

AddAcceptor adds a ChannelAcceptor to this ChainedAcceptor.

func (*ChainedAcceptor) RemoveAcceptor

func (c *ChainedAcceptor) RemoveAcceptor(id uint64)

RemoveAcceptor removes a ChannelAcceptor from this ChainedAcceptor given an ID.

type ChannelAcceptRequest

type ChannelAcceptRequest struct {
	// Node is the public key of the node requesting to open a channel.
	Node *btcec.PublicKey

	// OpenChanMsg is the actual OpenChannel protocol message that the peer
	// sent to us.
	OpenChanMsg *lnwire.OpenChannel
}

ChannelAcceptRequest is a struct containing the requesting node's public key along with the lnwire.OpenChannel message that they sent when requesting an inbound channel. This information is provided to each acceptor so that they can each leverage their own decision-making with this information.

type ChannelAcceptor

type ChannelAcceptor interface {
	Accept(req *ChannelAcceptRequest) bool
}

ChannelAcceptor is an interface that represents a predicate on the data contained in ChannelAcceptRequest.

type RPCAcceptor

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

RPCAcceptor represents the RPC-controlled variant of the ChannelAcceptor. One RPCAcceptor allows one RPC client.

func NewRPCAcceptor

func NewRPCAcceptor(closure func(*ChannelAcceptRequest) bool) *RPCAcceptor

NewRPCAcceptor creates and returns an instance of the RPCAcceptor.

func (*RPCAcceptor) Accept

func (r *RPCAcceptor) Accept(req *ChannelAcceptRequest) bool

Accept is a predicate on the ChannelAcceptRequest which is sent to the RPC client who will respond with the ultimate decision. This assumes an accept closure has been specified during creation.

NOTE: Part of the ChannelAcceptor interface.

Jump to

Keyboard shortcuts

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