lndc

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2016 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LNAdr

type LNAdr struct {
	LnID   [16]byte // redundant because adr contains it
	PubKey *btcec.PublicKey

	Base58Adr btcutil.Address // Base58 encoded address (1XXX...)
	NetAddr   *net.TCPAddr    // IP address
	// contains filtered or unexported fields
}

lnAddr... TODO(roasbeef): revamp

func LnAddrFromString

func LnAddrFromString(encodedAddr string, netParams *chaincfg.Params) (*LNAdr, error)

newLnAddr...

func NewLnAdr

func NewLnAdr(addr *net.TCPAddr, pubkey *btcec.PublicKey,
	net *chaincfg.Params) (*LNAdr, error)

newLnAdr....

func (*LNAdr) Deserialize

func (l *LNAdr) Deserialize(s []byte) error

Deserialize an LNId from byte slice (on disk) Note that this does not check any internal consistency, because on local storage there's no point. Check separately if needed. Also, old and probably needs to be changed / updated

func (*LNAdr) String

func (l *LNAdr) String() string

String...

type LNDConn

type LNDConn struct {
	RemotePub  *btcec.PublicKey
	RemoteLNId [16]byte

	// If Authed == false, the remotePub is the EPHEMERAL key.
	// once authed == true, remotePub is who you're actually talking to.
	Authed bool

	// ViaPbx specifies whether this is a direct TCP connection or an
	// encapsulated PBX connection.
	// If going ViaPbx, Cn isn't used channels are used for Read() and
	// Write(), which are filled by the PBXhandler.
	ViaPbx      bool
	PbxIncoming chan []byte
	PbxOutgoing chan []byte

	Conn net.Conn
	// contains filtered or unexported fields
}

Conn...

func NewConn

func NewConn(conn net.Conn) *LNDConn

NewConn...

func (*LNDConn) Close

func (c *LNDConn) Close() error

Close closes the connection. Any blocked Read or Write operations will be unblocked and return errors. Part of the net.Conn interface.

func (*LNDConn) Dial

func (c *LNDConn) Dial(
	myId *btcec.PrivateKey, address string, remoteId []byte) error

Dial...

func (*LNDConn) LocalAddr

func (c *LNDConn) LocalAddr() net.Addr

LocalAddr returns the local network address. Part of the net.Conn interface. If PBX reports address of pbx host.

func (*LNDConn) Read

func (c *LNDConn) Read(b []byte) (n int, err error)

Read reads data from the connection. Read can be made to time out and return a Error with Timeout() == true after a fixed time limit; see SetDeadline and SetReadDeadline. Part of the net.Conn interface.

func (*LNDConn) RemoteAddr

func (c *LNDConn) RemoteAddr() net.Addr

RemoteAddr returns the remote network address. Part of the net.Conn interface.

func (*LNDConn) SetDeadline

func (c *LNDConn) SetDeadline(t time.Time) error

SetDeadline sets the read and write deadlines associated with the connection. It is equivalent to calling both SetReadDeadline and SetWriteDeadline. Part of the net.Conn interface.

func (*LNDConn) SetReadDeadline

func (c *LNDConn) SetReadDeadline(t time.Time) error

SetReadDeadline sets the deadline for future Read calls. A zero value for t means Read will not time out. Part of the net.Conn interface.

func (*LNDConn) SetWriteDeadline

func (c *LNDConn) SetWriteDeadline(t time.Time) error

SetWriteDeadline sets the deadline for future Write calls. Even if write times out, it may return n > 0, indicating that some of the data was successfully written. A zero value for t means Write will not time out. Part of the net.Conn interface.

func (*LNDConn) Write

func (c *LNDConn) Write(b []byte) (n int, err error)

Write writes data to the connection. Write can be made to time out and return a Error with Timeout() == true after a fixed time limit; see SetDeadline and SetWriteDeadline. Part of the net.Conn interface.

type Listener

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

Listener...

func NewListener

func NewListener(localPriv *btcec.PrivateKey, listenAddr string) (*Listener, error)

NewListener...

func (*Listener) Accept

func (l *Listener) Accept() (c net.Conn, err error)

Accept waits for and returns the next connection to the listener. Part of the net.Listener interface.

func (*Listener) Addr

func (l *Listener) Addr() net.Addr

Addr returns the listener's network address. Part of the net.Listener interface.

func (*Listener) Close

func (l *Listener) Close() error

Close closes the listener. Any blocked Accept operations will be unblocked and return errors. Part of the net.Listener interface.

Jump to

Keyboard shortcuts

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