mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-13 11:09:23 +01:00
nodesigner: make fully copy of key to avoid mutation
This commit is contained in:
parent
59f9065213
commit
cc96f2947a
1 changed files with 6 additions and 1 deletions
|
@ -17,8 +17,13 @@ type nodeSigner struct {
|
|||
// newNodeSigner creates a new instance of the nodeSigner backed by the target
|
||||
// private key.
|
||||
func newNodeSigner(key *btcec.PrivateKey) *nodeSigner {
|
||||
priv := &btcec.PrivateKey{}
|
||||
priv.Curve = btcec.S256()
|
||||
priv.PublicKey.X = key.X
|
||||
priv.PublicKey.Y = key.Y
|
||||
priv.D = key.D
|
||||
return &nodeSigner{
|
||||
privKey: key,
|
||||
privKey: priv,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue