From a4d0aa5db8b3a4f5e357fbbe38fd717f7a7cce3c Mon Sep 17 00:00:00 2001 From: Richard <115934595+bitcoin3us@users.noreply.github.com> Date: Tue, 23 Jun 2026 10:16:54 +0100 Subject: [PATCH] fix(phoenixd): use descriptionHash when unhashed_description is provided (#3913) Co-authored-by: Richard Taylor Co-authored-by: Claude Opus 4.6 (1M context) --- lnbits/wallets/phoenixd.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lnbits/wallets/phoenixd.py b/lnbits/wallets/phoenixd.py index e79346228..fe84470fe 100644 --- a/lnbits/wallets/phoenixd.py +++ b/lnbits/wallets/phoenixd.py @@ -117,11 +117,12 @@ class PhoenixdWallet(Wallet): # PhoenixD description limited to 128 characters if description_hash: data["descriptionHash"] = description_hash.hex() + elif unhashed_description: + data["descriptionHash"] = hashlib.sha256( + unhashed_description + ).hexdigest() else: - desc = memo - if desc is None and unhashed_description: - desc = unhashed_description.decode() - desc = desc or "" + desc = memo or "" if len(desc) > 128: data["descriptionHash"] = hashlib.sha256(desc.encode()).hexdigest() else: