mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-13 18:10:25 +02:00
watchtower/wtdb/client_session: replace keydesc w/ KeyIndex
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcec"
|
"github.com/btcsuite/btcd/btcec"
|
||||||
"github.com/lightningnetwork/lnd/keychain"
|
|
||||||
"github.com/lightningnetwork/lnd/lnwire"
|
"github.com/lightningnetwork/lnd/lnwire"
|
||||||
"github.com/lightningnetwork/lnd/watchtower/wtpolicy"
|
"github.com/lightningnetwork/lnd/watchtower/wtpolicy"
|
||||||
)
|
)
|
||||||
@@ -57,14 +56,17 @@ type ClientSession struct {
|
|||||||
// tower with TowerID.
|
// tower with TowerID.
|
||||||
Tower *Tower
|
Tower *Tower
|
||||||
|
|
||||||
// SessionKeyDesc is the key descriptor used to derive the client's
|
// KeyIndex is the index of key locator used to derive the client's
|
||||||
// session key so that it can authenticate with the tower to update its
|
// session key so that it can authenticate with the tower to update its
|
||||||
// session.
|
// session. In order to rederive the private key, the key locator should
|
||||||
SessionKeyDesc keychain.KeyLocator
|
// use the keychain.KeyFamilyTowerSession key family.
|
||||||
|
KeyIndex uint32
|
||||||
|
|
||||||
// SessionPrivKey is the ephemeral secret key used to connect to the
|
// SessionPrivKey is the ephemeral secret key used to connect to the
|
||||||
// watchtower.
|
// watchtower.
|
||||||
// TODO(conner): remove after HD keys
|
//
|
||||||
|
// NOTE: This value is not serialized. It is derived using the KeyIndex
|
||||||
|
// on startup to avoid storing private keys on disk.
|
||||||
SessionPrivKey *btcec.PrivateKey
|
SessionPrivKey *btcec.PrivateKey
|
||||||
|
|
||||||
// Policy holds the negotiated session parameters.
|
// Policy holds the negotiated session parameters.
|
||||||
|
@@ -104,7 +104,7 @@ func (m *ClientDB) CreateClientSession(session *wtdb.ClientSession) error {
|
|||||||
|
|
||||||
m.activeSessions[session.ID] = &wtdb.ClientSession{
|
m.activeSessions[session.ID] = &wtdb.ClientSession{
|
||||||
TowerID: session.TowerID,
|
TowerID: session.TowerID,
|
||||||
SessionKeyDesc: session.SessionKeyDesc,
|
KeyIndex: session.KeyIndex,
|
||||||
SessionPrivKey: session.SessionPrivKey,
|
SessionPrivKey: session.SessionPrivKey,
|
||||||
ID: session.ID,
|
ID: session.ID,
|
||||||
Policy: session.Policy,
|
Policy: session.Policy,
|
||||||
|
Reference in New Issue
Block a user