diff --git a/dist/setup.sh b/dist/setup.sh index e46663d08..a9877a961 100755 --- a/dist/setup.sh +++ b/dist/setup.sh @@ -928,7 +928,7 @@ OTSCLIENT_VERSION="v0.9.0-dev" PYCOIN_VERSION="v0.9.0-dev" CYPHERAPPS_VERSION="dev" BITCOIN_VERSION="v24.0.1-mosquitto-debian" -LIGHTNING_VERSION="v23.11.2-pg" +LIGHTNING_VERSION="v24.11.1-pg" TRAEFIK_VERSION="v2.6.3" MOSQUITTO_VERSION="1.6-openssl" POSTGRES_VERSION="14.0-bullseye" diff --git a/proxy_docker/app/script/call_lightningd.sh b/proxy_docker/app/script/call_lightningd.sh index 764ff096a..9c25922ee 100644 --- a/proxy_docker/app/script/call_lightningd.sh +++ b/proxy_docker/app/script/call_lightningd.sh @@ -459,10 +459,21 @@ ln_listpays() { trace "Entering ln_listpays()..." local result - local bolt11=${1} - trace "[ln_listpays] bolt11=${bolt11}" - - result=$(ln_call_lightningd listpays "${bolt11}") + local request=${1} + local bolt11=$(echo "${request}" | jq -r '.bolt11 // ""') + local status=$(echo "${request}" | jq -r '.status // ""') + local start=$(echo "${request}" | jq -r '.start // ""') + local limit=$(echo "${request}" | jq -r '.limit // ""') + local cln_args="" + [ -n "${bolt11}" ] && cln_args="${cln_args} bolt11=${bolt11}" + [ -n "${status}" ] && cln_args="${cln_args} status=${status}" + [ -n "${start}" ] && cln_args="${cln_args} start=${start}" + [ -n "${limit}" ] && cln_args="${cln_args} limit=${limit}" + if [ -n "${start}" ] || [ -n "${limit}" ]; then + cln_args="${cln_args} index=created" + fi + trace "[ln_listpays] cln_args=${cln_args}" + result=$(ln_call_lightningd -k listpays ${cln_args}) returncode=$? echo "${result}" diff --git a/proxy_docker/app/script/requesthandler.sh b/proxy_docker/app/script/requesthandler.sh index d7f014cd3..cce54986c 100644 --- a/proxy_docker/app/script/requesthandler.sh +++ b/proxy_docker/app/script/requesthandler.sh @@ -824,12 +824,10 @@ main() { # Let's make it work even for a GET request (equivalent to a POST with empty json object body) if [ "$http_method" = "POST" ]; then - bolt11=$(echo "${line}" | jq -r ".bolt11 // empty") + response=$(ln_listpays "${line}") else - bolt11= + response=$(ln_listpays "{}") fi - - response=$(ln_listpays "${bolt11}") returncode=$? ;; ln_paystatus)