lnd+watchtower: rename NodePrivKey to NodeKeyECDH

This commit is contained in:
Oliver Gugger 2020-04-28 10:06:23 +02:00
parent 7f1b865b53
commit 140731af00
No known key found for this signature in database
GPG Key ID: 8E4256593F177720
5 changed files with 12 additions and 12 deletions

2
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,
}

@ -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.

@ -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

@ -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,
}

@ -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