@@ -140,7 +140,7 @@ wait_for_lightningd() {
140140
141141clnrest_status () {
142142 logfile=" $1 "
143- active_str=" plugin-clnrest: REST Server is starting "
143+ active_str=" plugin-clnrest: REST server running "
144144 disabled_str=" plugin-clnrest: Killing plugin: disabled itself"
145145
146146 if grep -q " $active_str " " $logfile " ; then
@@ -152,6 +152,11 @@ clnrest_status() {
152152 fi
153153}
154154
155+ has_clnrest () {
156+ test -x " $LIGHTNING_BIN /plugins/clnrest"
157+ return $?
158+ }
159+
155160start_nodes () {
156161 if [ -z " $1 " ]; then
157162 node_count=2
@@ -203,7 +208,7 @@ funder-lease-requests-only=false
203208 EOF
204209
205210 # If clnrest loads, add the port so it will run
206- if [ -n " $ACTIVATE_CLNREST " ] ; then
211+ if has_clnrest ; then
207212 echo " clnrest-port=$(( 3109 + i)) " >> " $LIGHTNING_DIR /l$i /config"
208213 fi
209214
@@ -260,16 +265,12 @@ start_ln() {
260265 else
261266 nodes=" $1 "
262267 fi
263- # Are the clnrest dependencies installed?
264- if timeout 2 python3 plugins/clnrest/clnrest > /dev/null 2>&1 ; then
265- ACTIVATE_CLNREST=1
266- fi
267268 start_nodes " $nodes " regtest
268269 echo " bt-cli, stop_ln, fund_nodes"
269270
270271 wait_for_lightningd " $nodes "
271272 active_status=$( clnrest_status " $LIGHTNING_DIR /l1/log" )
272- if [ -n " $ACTIVATE_CLNREST " ] && [ " $active_status " = " active" ] ; then
273+ if has_clnrest && [ " $active_status " = " active" ] ; then
273274 node_info regtest
274275 elif [ " $active_status " = " disabled" ]; then
275276 echo " clnrest is disabled."
0 commit comments