lnd: use distinct pubkey for watchtowers and server

This commit is contained in:
Conner Fromknecht
2019-06-20 16:55:52 -07:00
parent a7415336bc
commit ea311649b4
2 changed files with 50 additions and 7 deletions

14
lnd.go
View File

@@ -344,6 +344,18 @@ func Main() error {
}
defer towerDB.Close()
towerPrivKey, err := activeChainControl.wallet.DerivePrivKey(
keychain.KeyDescriptor{
KeyLocator: keychain.KeyLocator{
Family: keychain.KeyFamilyTowerID,
Index: 0,
},
},
)
if err != nil {
return err
}
wtConfig, err := cfg.Watchtower.Apply(&watchtower.Config{
BlockFetcher: activeChainControl.chainIO,
DB: towerDB,
@@ -354,7 +366,7 @@ func Main() error {
lnwallet.WitnessPubKey, false,
)
},
NodePrivKey: idPrivKey,
NodePrivKey: towerPrivKey,
PublishTx: activeChainControl.wallet.PublishTransaction,
ChainHash: *activeNetParams.GenesisHash,
}, lncfg.NormalizeAddresses)