lnwallet: remove old deprecated MessageSigner struct

This commit is contained in:
Olaoluwa Osuntokun 2017-04-14 11:00:02 -07:00
parent b226edf96e
commit 98c58ddb67
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2
1 changed files with 0 additions and 33 deletions

View File

@ -1,33 +0,0 @@
package lnwallet
import (
"fmt"
"github.com/roasbeef/btcd/btcec"
"github.com/roasbeef/btcd/chaincfg/chainhash"
)
// MessageSigner is used for creation the signatures using the node identity key.
// By message we mean the whole range of data that might require our approve,
// starting from node, channel, channel update announcements and ending by user
// data.
type MessageSigner struct {
identityKey *btcec.PrivateKey
}
// NewMessageSigner returns the new instance of message signer.
func NewMessageSigner(key *btcec.PrivateKey) *MessageSigner {
return &MessageSigner{
identityKey: key,
}
}
// SignData sign the message with the node private key.
func (s *MessageSigner) SignData(data []byte) (*btcec.Signature, error) {
sign, err := s.identityKey.Sign(chainhash.DoubleHashB(data))
if err != nil {
return nil, fmt.Errorf("can't sign the message: %v", err)
}
return sign, nil
}