From 77d2853d76018de76eb7c008c9bdf8e029e580f5 Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Thu, 5 Jul 2018 13:26:55 -0700 Subject: [PATCH] lnpeer: extend interface Address and AddNewChannel methods --- lnpeer/peer.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lnpeer/peer.go b/lnpeer/peer.go index 5664bab9..99efe845 100644 --- a/lnpeer/peer.go +++ b/lnpeer/peer.go @@ -1,8 +1,11 @@ package lnpeer import ( + "net" + "github.com/btcsuite/btcd/btcec" "github.com/btcsuite/btcd/wire" + "github.com/lightningnetwork/lnd/lnwallet" "github.com/lightningnetwork/lnd/lnwire" ) @@ -14,6 +17,10 @@ type Peer interface { // has been sent to the remote peer. 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 // point from all indexes associated with the peer. WipeChannel(*wire.OutPoint) error @@ -23,4 +30,7 @@ type Peer interface { // IdentityKey returns the public key of the remote peer. IdentityKey() *btcec.PublicKey + + // Address returns the network address of the remote peer. + Address() net.Addr }