lnd: populate lightning id within server
This commit is contained in:
parent
94c242073a
commit
2512fecf88
@ -7,6 +7,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
|
|
||||||
|
"github.com/btcsuite/fastsha256"
|
||||||
"github.com/lightningnetwork/lnd/channeldb"
|
"github.com/lightningnetwork/lnd/channeldb"
|
||||||
"github.com/lightningnetwork/lnd/lndc"
|
"github.com/lightningnetwork/lnd/lndc"
|
||||||
"github.com/lightningnetwork/lnd/lnwallet"
|
"github.com/lightningnetwork/lnd/lnwallet"
|
||||||
@ -29,6 +30,10 @@ type server struct {
|
|||||||
// connections.
|
// connections.
|
||||||
identityPriv *btcec.PrivateKey
|
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
|
listeners []net.Listener
|
||||||
peers map[int32]*peer
|
peers map[int32]*peer
|
||||||
|
|
||||||
@ -69,11 +74,13 @@ func newServer(listenAddrs []string, wallet *lnwallet.LightningWallet,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
serializedPubKey := privKey.PubKey().SerializeCompressed()
|
||||||
s := &server{
|
s := &server{
|
||||||
chanDB: chanDB,
|
chanDB: chanDB,
|
||||||
fundingMgr: newFundingManager(wallet),
|
fundingMgr: newFundingManager(wallet),
|
||||||
lnwallet: wallet,
|
lnwallet: wallet,
|
||||||
identityPriv: privKey,
|
identityPriv: privKey,
|
||||||
|
lightningID: fastsha256.Sum256(serializedPubKey),
|
||||||
listeners: listeners,
|
listeners: listeners,
|
||||||
peers: make(map[int32]*peer),
|
peers: make(map[int32]*peer),
|
||||||
chanIndex: make(map[wire.OutPoint]*peer),
|
chanIndex: make(map[wire.OutPoint]*peer),
|
||||||
|
Loading…
Reference in New Issue
Block a user