if expected_msatoshi not provided, then skip checks

This commit is contained in:
g-homebase
2020-03-03 09:07:04 -05:00
committed by kexkey
parent 45ab43b135
commit 1e1b2f1eb7

View File

@@ -327,7 +327,7 @@ ln_pay() {
# The amount must match if not "any"
# If the amount is not in the invoice and not supplied as expected_msatoshi, then both will be null, that's ok!
# Same thing goes for the description.
if [ "${expected_msatoshi}" != "${invoice_msatoshi}" ] && [ "${invoice_msatoshi}" != "null" ]; then
if [ -n "${expected_msatoshi}" ] && [ "${expected_msatoshi}" != "null" ] && [ "${expected_msatoshi}" != "${invoice_msatoshi}" ] && [ "${invoice_msatoshi}" != "null" ]; then
# If invoice_msatoshi is null, that means "any" was supplied, so the amounts don't have to match!
result="{\"result\":\"error\",\"expected_msatoshi\":${expected_msatoshi},\"invoice_msatoshi\":${invoice_msatoshi}}"
returncode=1