mirror of
https://github.com/ChuckNorrison/LightningTipBot.git
synced 2026-08-18 13:08:52 +02:00
Fix lnurlpserver (#132)
* fix server * go-lnurl v1.8.4 * encode Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
This commit is contained in:
parent
8c4adb4dd4
commit
88bbd4d2cf
1 changed files with 1 additions and 6 deletions
|
|
@ -3,7 +3,6 @@ package lnurl
|
|||
import (
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
|
@ -193,11 +192,7 @@ func (w Server) serveLNURLpSecond(username string, amount int64, comment string)
|
|||
|
||||
// descriptionHash is the SHA256 hash of the metadata
|
||||
func (w Server) descriptionHash(metadata lnurl.Metadata) (string, error) {
|
||||
jsonMeta, err := json.Marshal(metadata)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
hash := sha256.Sum256([]byte(string(jsonMeta)))
|
||||
hash := sha256.Sum256([]byte(metadata.Encode()))
|
||||
hashString := hex.EncodeToString(hash[:])
|
||||
return hashString, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue