Skip to content

Commit

Permalink
assume that description_hash is a hash already
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Jul 30, 2022
1 parent 54115cd commit d8775b9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lnbits/bolt11.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,11 @@ def lnencode(addr, privkey):
expirybits = expirybits[5:]
data += tagged("x", expirybits)
elif k == "h":
data += tagged_bytes("h", hashlib.sha256(v.encode("utf-8")).digest())
# previously: assume that description_hash is a string that needs to be hashed
# data += tagged_bytes("h", hashlib.sha256(v.encode("utf-8")).digest())
data += tagged_bytes(
"h", unhexlify(v)
) # assume that description_hash is a hash already
elif k == "n":
data += tagged_bytes("n", v)
else:
Expand Down

0 comments on commit d8775b9

Please sign in to comment.