mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-17 19:12:44 +02:00
Let invoice.Encode receive a function which hashes itself the message
Modify the SignCompact function passed to invoice.Encode to receive the message before it's hashed and hash it itself. With this modification, the SignMessage rpc function from the signrpc subserver can be used and an invoice can be encoded outside of lnd.
This commit is contained in:
@@ -100,11 +100,11 @@ var (
|
||||
// MessageSigner is passed to the Encode method to provide a signature
|
||||
// corresponding to the node's pubkey.
|
||||
type MessageSigner struct {
|
||||
// SignCompact signs the passed hash with the node's privkey. The
|
||||
// returned signature should be 65 bytes, where the last 64 are the
|
||||
// SignCompact signs the hash of the passed msg with the node's privkey.
|
||||
// The returned signature should be 65 bytes, where the last 64 are the
|
||||
// compact signature, and the first one is a header byte. This is the
|
||||
// format returned by btcec.SignCompact.
|
||||
SignCompact func(hash []byte) ([]byte, error)
|
||||
SignCompact func(msg []byte) ([]byte, error)
|
||||
}
|
||||
|
||||
// Invoice represents a decoded invoice, or to-be-encoded invoice. Some of the
|
||||
|
Reference in New Issue
Block a user