Fix invoice amount check in recurring-donations

This commit is contained in:
Jonas Nick 2019-04-22 00:37:45 +00:00
parent 492eab0e26
commit bb9aa8fb29
No known key found for this signature in database
GPG Key ID: 4861DBF262123605

View File

@ -16,7 +16,7 @@ let
return
fi
# Decode invoice and compare amount with requested amount
DECODED_AMOUNT=$($LNCLI decodepay "$INVOICE" | jq -r '.amount_msat' | head -c 4)
DECODED_AMOUNT=$($LNCLI decodepay "$INVOICE" | jq -r '.amount_msat' | head -c -8)
if [ -z "$DECODED_AMOUNT" ] || [ "$DECODED_AMOUNT" = "null" ]; then
echo "ERROR: did not get response from clightning"
return