From 100bb80b170020df68641721f6dfd400a06ac834 Mon Sep 17 00:00:00 2001 From: fusion44 Date: Fri, 1 Jul 2022 21:12:54 +0200 Subject: [PATCH] fix: don't assume that there is a bolt11 string On keysend payments there usually is no bolt11 string. refs #125 --- app/repositories/ln_impl/cln_grpc.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/repositories/ln_impl/cln_grpc.py b/app/repositories/ln_impl/cln_grpc.py index 8c9386c..bd1e2dc 100644 --- a/app/repositories/ln_impl/cln_grpc.py +++ b/app/repositories/ln_impl/cln_grpc.py @@ -222,12 +222,14 @@ async def list_all_tx_impl( for pay in res[2].pays: comment = "" - if pay.bolt11 in memo_cache: - comment = memo_cache[pay.bolt11] - else: - pr = await decode_pay_request_impl(pay.bolt11) - comment = pr.description - memo_cache[pay.bolt11] = pr.description + if pay.bolt11 is not None and len(pay.bolt11) > 0: + if pay.bolt11 in memo_cache: + comment = memo_cache[pay.bolt11] + else: + pr = await decode_pay_request_impl(pay.bolt11) + comment = pr.description + memo_cache[pay.bolt11] = pr.description + p = GenericTx.from_cln_grpc_payment(pay, comment) if successful_only and p.status == TxStatus.SUCCEEDED: