Merge pull request #4423 from breez/enable-encode-invoice-via-rpc
Let invoice.Encode receive a function which hashes itself the message
This commit is contained in:
4 files changed
+14
-9
No files matched your search
@@ -10,6 +10,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/btcsuite/btcd/chaincfg"
|
||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/btcsuite/btcutil"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
@@ -329,7 +330,10 @@ func AddInvoice(ctx context.Context, cfg *AddInvoiceConfig,
|
||||
|
||||
payReqString, err := payReq.Encode(
|
||||
zpay32.MessageSigner{
|
||||
SignCompact: cfg.NodeSigner.SignDigestCompact,
|
||||
SignCompact: func(msg []byte) ([]byte, error) {
|
||||
hash := chainhash.HashB(msg)
|
||||
return cfg.NodeSigner.SignDigestCompact(hash)
|
||||
},
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user