lnwallet+lnd: ensure curve parameters are set to avoid panics

This commit fixes a bug introduced by the past attempt to Make Logging
Great Again. Since we unset the curve parameters when reading/writing
the messages, if we have a lingering reference that’s active elsewhere
in the daemon, then we’ll modify that reference. To fix this, we now
explicitly set the Curve parameters in two areas.

A similar commit has been pushed to lightning-onion.
This commit is contained in:
Olaoluwa Osuntokun 2017-01-14 19:44:21 -08:00
parent ee96052e44
commit 55f89be10f
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2
2 changed files with 2 additions and 0 deletions

View File

@ -1312,6 +1312,7 @@ func (lc *LightningChannel) ReceiveNewCommitment(rawSig []byte,
// Ensure that the newly constructed commitment state has a valid
// signature.
theirMultiSigKey.Curve = btcec.S256()
sig, err := btcec.ParseSignature(rawSig, btcec.S256())
if err != nil {
return err

View File

@ -90,6 +90,7 @@ func newServer(listenAddrs []string, notifier chainntnfs.ChainNotifier,
if err != nil {
return nil, err
}
privKey.Curve = btcec.S256()
listeners := make([]net.Listener, len(listenAddrs))
for i, addr := range listenAddrs {