nodesigner: make fully copy of key to avoid mutation

This commit is contained in:
Olaoluwa Osuntokun 2017-08-04 18:27:13 -07:00
parent 59f9065213
commit cc96f2947a
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2

@ -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,
}
}