From b0cb110e864d9047409b947ad1a2e2090e33b885 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Tue, 28 Apr 2020 10:06:24 +0200 Subject: [PATCH] watchtower: rename SessionPrivKey to SessionKeyECDH --- watchtower/wtclient/client.go | 2 +- watchtower/wtclient/session_negotiator.go | 2 +- watchtower/wtclient/session_queue.go | 2 +- watchtower/wtdb/client_session.go | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/watchtower/wtclient/client.go b/watchtower/wtclient/client.go index 1f3c1c3c..c3bf70b5 100644 --- a/watchtower/wtclient/client.go +++ b/watchtower/wtclient/client.go @@ -362,7 +362,7 @@ func getClientSessions(db DB, keyRing SecretKeyRing, forTower *wtdb.TowerID, if err != nil { return nil, err } - s.SessionPrivKey = sessionKey + s.SessionKeyECDH = sessionKey // If an optional filter was provided, use it to filter out any // undesired sessions. diff --git a/watchtower/wtclient/session_negotiator.go b/watchtower/wtclient/session_negotiator.go index e6ccbfb9..ae894762 100644 --- a/watchtower/wtclient/session_negotiator.go +++ b/watchtower/wtclient/session_negotiator.go @@ -428,7 +428,7 @@ func (n *sessionNegotiator) tryAddress(privKey *btcec.PrivateKey, RewardPkScript: rewardPkScript, }, Tower: tower, - SessionPrivKey: privKey, + SessionKeyECDH: privKey, ID: sessionID, } diff --git a/watchtower/wtclient/session_queue.go b/watchtower/wtclient/session_queue.go index 87834815..b383644c 100644 --- a/watchtower/wtclient/session_queue.go +++ b/watchtower/wtclient/session_queue.go @@ -285,7 +285,7 @@ func (q *sessionQueue) sessionManager() { // drainBackups attempts to send all pending updates in the queue to the tower. func (q *sessionQueue) drainBackups() { // First, check that we are able to dial this session's tower. - conn, err := q.cfg.Dial(q.cfg.ClientSession.SessionPrivKey, q.towerAddr) + conn, err := q.cfg.Dial(q.cfg.ClientSession.SessionKeyECDH, q.towerAddr) if err != nil { log.Errorf("SessionQueue(%s) unable to dial tower at %v: %v", q.ID(), q.towerAddr, err) diff --git a/watchtower/wtdb/client_session.go b/watchtower/wtdb/client_session.go index cbf58c51..eb76528c 100644 --- a/watchtower/wtdb/client_session.go +++ b/watchtower/wtdb/client_session.go @@ -60,12 +60,12 @@ type ClientSession struct { // tower with TowerID. Tower *Tower - // SessionPrivKey is the ephemeral secret key used to connect to the - // watchtower. + // SessionKeyECDH is the ECDH capable wrapper of the ephemeral secret + // key used to connect to the watchtower. // // NOTE: This value is not serialized. It is derived using the KeyIndex // on startup to avoid storing private keys on disk. - SessionPrivKey *btcec.PrivateKey + SessionKeyECDH *btcec.PrivateKey } // ClientSessionBody represents the primary components of a ClientSession that