mirror of
https://github.com/aljazceru/cyphernode.git
synced 2025-12-17 04:35:14 +01:00
add listpays
This commit is contained in:
@@ -30,6 +30,7 @@ action_ln_getconnectionstring=watcher
|
||||
action_ln_decodebolt11=watcher
|
||||
action_ln_listpeers=watcher
|
||||
action_ln_getroute=watcher
|
||||
action_ln_listpays=watcher
|
||||
|
||||
# Spender can do what the watcher can do, plus:
|
||||
action_getxnslist=spender
|
||||
|
||||
@@ -482,6 +482,16 @@ ln_listfunds() {
|
||||
echo "${result}"
|
||||
return ${returncode}
|
||||
}
|
||||
ln_listpays() {
|
||||
trace "Entering ln_listpays()..."
|
||||
local result
|
||||
result=$(./lightning-cli listpays)
|
||||
returncode=$?
|
||||
trace_rc ${returncode}
|
||||
trace "[ln_listpays] result=${result}"
|
||||
echo "${result}"
|
||||
return ${returncode}
|
||||
}
|
||||
ln_getroute() {
|
||||
trace "Entering ln_getroute()..."
|
||||
# Defaults used from c-lightning documentation
|
||||
|
||||
@@ -423,6 +423,12 @@ main() {
|
||||
response_to_client "${response}" ${?}
|
||||
break
|
||||
;;
|
||||
ln_listpays)
|
||||
# GET http://192.168.111.152:8080/ln_listpays
|
||||
response=$(ln_listpays)
|
||||
response_to_client "${response}" ${?}
|
||||
break
|
||||
;;
|
||||
ln_getroute)
|
||||
# GET http://192.168.111.152:8080/ln_getroute/<node_id>/<msatoshi>/<riskfactor>
|
||||
response=$(ln_getroute $(echo "${line}" | cut -d ' ' -f2 | cut -d '/' -f3) $(echo "${line}" | cut -d ' ' -f2 | cut -d '/' -f4) $(echo "${line}" | cut -d ' ' -f2 | cut -d '/' -f5))
|
||||
|
||||
Reference in New Issue
Block a user