From 140731af00753a8823037ab1669d6835bb19977b Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Tue, 28 Apr 2020 10:06:23 +0200 Subject: [PATCH] lnd+watchtower: rename NodePrivKey to NodeKeyECDH --- lnd.go | 2 +- watchtower/config.go | 6 +++--- watchtower/standalone.go | 6 +++--- watchtower/wtclient/client_test.go | 4 ++-- watchtower/wtserver/server.go | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lnd.go b/lnd.go index 840e684f..f519e3f2 100644 --- a/lnd.go +++ b/lnd.go @@ -570,7 +570,7 @@ func Main(cfg *Config, lisCfg ListenerCfg, shutdownChan <-chan struct{}) error { lnwallet.WitnessPubKey, false, ) }, - NodePrivKey: towerPrivKey, + NodeKeyECDH: towerPrivKey, PublishTx: activeChainControl.wallet.PublishTransaction, ChainHash: *activeNetParams.GenesisHash, } diff --git a/watchtower/config.go b/watchtower/config.go index 7ef8a617..2b649dbc 100644 --- a/watchtower/config.go +++ b/watchtower/config.go @@ -63,9 +63,9 @@ type Config struct { // successfully sent funds can be received. NewAddress func() (btcutil.Address, error) - // NodePrivKey is private key to be used in accepting new brontide - // connections. - NodePrivKey *btcec.PrivateKey + // NodeKeyECDH is the ECDH capable wrapper of the key to be used in + // accepting new brontide connections. + NodeKeyECDH *btcec.PrivateKey // PublishTx provides the ability to send a signed transaction to the // network. diff --git a/watchtower/standalone.go b/watchtower/standalone.go index 6dd3fe6d..8e56d962 100644 --- a/watchtower/standalone.go +++ b/watchtower/standalone.go @@ -72,7 +72,7 @@ func New(cfg *Config) (*Standalone, error) { listeners := make([]net.Listener, 0, len(cfg.ListenAddrs)) for _, listenAddr := range cfg.ListenAddrs { listener, err := brontide.NewListener( - cfg.NodePrivKey, listenAddr.String(), + cfg.NodeKeyECDH, listenAddr.String(), ) if err != nil { return nil, err @@ -85,7 +85,7 @@ func New(cfg *Config) (*Standalone, error) { server, err := wtserver.New(&wtserver.Config{ ChainHash: cfg.ChainHash, DB: cfg.DB, - NodePrivKey: cfg.NodePrivKey, + NodeKeyECDH: cfg.NodeKeyECDH, Listeners: listeners, ReadTimeout: cfg.ReadTimeout, WriteTimeout: cfg.WriteTimeout, @@ -190,7 +190,7 @@ func (w *Standalone) createNewHiddenService() error { // // NOTE: Part of the watchtowerrpc.WatchtowerBackend interface. func (w *Standalone) PubKey() *btcec.PublicKey { - return w.cfg.NodePrivKey.PubKey() + return w.cfg.NodeKeyECDH.PubKey() } // ListeningAddrs returns the listening addresses where the watchtower server diff --git a/watchtower/wtclient/client_test.go b/watchtower/wtclient/client_test.go index 577d33f9..fda9c0e2 100644 --- a/watchtower/wtclient/client_test.go +++ b/watchtower/wtclient/client_test.go @@ -416,7 +416,7 @@ func newHarness(t *testing.T, cfg harnessCfg) *testHarness { DB: serverDB, ReadTimeout: timeout, WriteTimeout: timeout, - NodePrivKey: privKey, + NodeKeyECDH: privKey, NewAddress: func() (btcutil.Address, error) { return addr, nil }, @@ -519,7 +519,7 @@ func (h *testHarness) startClient() { h.t.Fatalf("Unable to resolve tower TCP addr: %v", err) } towerAddr := &lnwire.NetAddress{ - IdentityKey: h.serverCfg.NodePrivKey.PubKey(), + IdentityKey: h.serverCfg.NodeKeyECDH.PubKey(), Address: towerTCPAddr, } diff --git a/watchtower/wtserver/server.go b/watchtower/wtserver/server.go index 1c46201b..0152839a 100644 --- a/watchtower/wtserver/server.go +++ b/watchtower/wtserver/server.go @@ -33,9 +33,9 @@ type Config struct { // storing state updates. DB DB - // NodePrivKey is private key to be used in accepting new brontide - // connections. - NodePrivKey *btcec.PrivateKey + // NodeKeyECDH is the the ECDH capable wrapper of the key to be used in + // accepting new brontide connections. + NodeKeyECDH *btcec.PrivateKey // Listeners specifies which address to which clients may connect. Listeners []net.Listener