nodesigner: make fully copy of key to avoid mutation

This commit is contained in:
Olaoluwa Osuntokun committed 2017-08-04 18:27:21 -07:00
1 parent 59f9065213
commit cc96f2947a
1 file changed
+6 -1
+6 -1
View File
@@ -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,
}
}