@@ -145,7 +145,7 @@ wait_for_lightningd() {
145145
146146clnrest_status () {
147147 logfile=" $1 "
148- active_str=" plugin-clnrest: REST Server is starting "
148+ active_str=" plugin-clnrest: REST server running "
149149 disabled_str=" plugin-clnrest: Killing plugin: disabled itself"
150150
151151 if grep -q " $active_str " " $logfile " ; then
@@ -157,6 +157,11 @@ clnrest_status() {
157157 fi
158158}
159159
160+ has_clnrest () {
161+ test -x " $LIGHTNING_BIN /plugins/clnrest"
162+ return $?
163+ }
164+
160165start_nodes () {
161166 if [ -z " $1 " ]; then
162167 node_count=2
@@ -207,7 +212,7 @@ funder-lease-requests-only=false
207212 EOF
208213
209214 # If clnrest loads, add the port so it will run
210- if [ -n " $ACTIVATE_CLNREST " ] ; then
215+ if has_clnrest ; then
211216 echo " clnrest-port=$(( 3109 + i)) " >> " $LIGHTNING_DIR /l$i /config"
212217 fi
213218
@@ -269,16 +274,12 @@ start_ln() {
269274 else
270275 nodes=" $1 "
271276 fi
272- # Are the clnrest dependencies installed?
273- if timeout 2 python3 plugins/clnrest/clnrest > /dev/null 2>&1 ; then
274- ACTIVATE_CLNREST=1
275- fi
276277 start_nodes " $nodes " regtest
277278 echo " bt-cli, stop_ln, fund_nodes"
278279
279280 wait_for_lightningd " $nodes "
280281 active_status=$( clnrest_status " $LIGHTNING_DIR /l1/log" )
281- if [ -n " $ACTIVATE_CLNREST " ] && [ " $active_status " = " active" ] ; then
282+ if has_clnrest && [ " $active_status " = " active" ] ; then
282283 node_info regtest
283284 elif [ " $active_status " = " disabled" ]; then
284285 echo " clnrest is disabled."
0 commit comments