nodesigner: make fully copy of key to avoid mutation
This commit is contained in:
parent
59f9065213
commit
cc96f2947a
@ -17,8 +17,13 @@ type nodeSigner struct {
|
|||||||
// newNodeSigner creates a new instance of the nodeSigner backed by the target
|
// newNodeSigner creates a new instance of the nodeSigner backed by the target
|
||||||
// private key.
|
// private key.
|
||||||
func newNodeSigner(key *btcec.PrivateKey) *nodeSigner {
|
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{
|
return &nodeSigner{
|
||||||
privKey: key,
|
privKey: priv,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user