lnpeer: extend interface Address and AddNewChannel methods

This commit is contained in:
Wilmer Paulino 2018-07-05 13:26:55 -07:00
parent 8c92df0f47
commit 77d2853d76
No known key found for this signature in database
GPG Key ID: 6DF57B9F9514972F

@ -1,8 +1,11 @@
package lnpeer package lnpeer
import ( import (
"net"
"github.com/btcsuite/btcd/btcec" "github.com/btcsuite/btcd/btcec"
"github.com/btcsuite/btcd/wire" "github.com/btcsuite/btcd/wire"
"github.com/lightningnetwork/lnd/lnwallet"
"github.com/lightningnetwork/lnd/lnwire" "github.com/lightningnetwork/lnd/lnwire"
) )
@ -14,6 +17,10 @@ type Peer interface {
// has been sent to the remote peer. // has been sent to the remote peer.
SendMessage(sync bool, msg ...lnwire.Message) error SendMessage(sync bool, msg ...lnwire.Message) error
// AddNewChannel adds a new channel to the peer. The channel should fail
// to be added if the cancel channel is closed.
AddNewChannel(channel *lnwallet.LightningChannel, cancel <-chan struct{}) error
// WipeChannel removes the channel uniquely identified by its channel // WipeChannel removes the channel uniquely identified by its channel
// point from all indexes associated with the peer. // point from all indexes associated with the peer.
WipeChannel(*wire.OutPoint) error WipeChannel(*wire.OutPoint) error
@ -23,4 +30,7 @@ type Peer interface {
// IdentityKey returns the public key of the remote peer. // IdentityKey returns the public key of the remote peer.
IdentityKey() *btcec.PublicKey IdentityKey() *btcec.PublicKey
// Address returns the network address of the remote peer.
Address() net.Addr
} }