discovery: modify SignAnnouncement to take a MessageSigner

This commit modifies the SignAnnouncement helper function to instead
take a MessageSigner interface rather than the deprecated MessageSigner
struct.  We also modify the function to explicitly take the identity
public key to use when signing.
This commit is contained in:
Olaoluwa Osuntokun committed 2017-04-14 11:08:32 -07:00
1 parent 4e988b228e
commit 0f9c2e1d17
2 files changed
+39 -17

No files matched your search

+2 -2
View File
@@ -109,7 +109,7 @@ func copyPubKey(pub *btcec.PublicKey) *btcec.PublicKey {
// SignAnnouncement is a helper function which is used to sign any outgoing
// channel node node announcement messages.
func SignAnnouncement(signer *lnwallet.MessageSigner,
func SignAnnouncement(signer lnwallet.MessageSigner, pubKey *btcec.PublicKey,
msg lnwire.Message) (*btcec.Signature, error) {
var (
@@ -132,5 +132,5 @@ func SignAnnouncement(signer *lnwallet.MessageSigner,
return nil, errors.Errorf("unable to get data to sign: %v", err)
}
return signer.SignData(data)
return signer.SignMessage(pubKey, data)
}