mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 01:43:16 +01:00
lnd: populate lightning id within server
This commit is contained in:
parent
94c242073a
commit
2512fecf88
@ -7,6 +7,7 @@ import (
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/btcsuite/fastsha256"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/lndc"
|
||||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
@ -29,6 +30,10 @@ type server struct {
|
||||
// connections.
|
||||
identityPriv *btcec.PrivateKey
|
||||
|
||||
// lightningID is the sha256 of the public key corresponding to our
|
||||
// long-term identity private key.
|
||||
lightningID [32]byte
|
||||
|
||||
listeners []net.Listener
|
||||
peers map[int32]*peer
|
||||
|
||||
@ -69,11 +74,13 @@ func newServer(listenAddrs []string, wallet *lnwallet.LightningWallet,
|
||||
}
|
||||
}
|
||||
|
||||
serializedPubKey := privKey.PubKey().SerializeCompressed()
|
||||
s := &server{
|
||||
chanDB: chanDB,
|
||||
fundingMgr: newFundingManager(wallet),
|
||||
lnwallet: wallet,
|
||||
identityPriv: privKey,
|
||||
lightningID: fastsha256.Sum256(serializedPubKey),
|
||||
listeners: listeners,
|
||||
peers: make(map[int32]*peer),
|
||||
chanIndex: make(map[wire.OutPoint]*peer),
|
||||
|
Loading…
Reference in New Issue
Block a user