sn_channel_cron condtion to ensure sn_lnd conns to router_lnd (#2192)

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
This commit is contained in:
Will Sutton 2025-06-05 20:57:54 -04:00 committed by GitHub
parent f5dff4b0bb
commit 0002c0a0f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -356,7 +356,9 @@ services:
ofelia.job-exec.sn_channel_cron.schedule: "@every 1m"
ofelia.job-exec.sn_channel_cron.command: >
su lnd -c bash -c "
if [ $$(lncli getinfo | jq '.num_active_channels + .num_pending_channels') -ge 3 ]; then
if [ $$(lncli getinfo | jq '.num_active_channels + .num_pending_channels') -ge 6 ]; then
exit 0
elif [ $$(lncli listchannels --peer=$ROUTER_LND_PUBKEY | jq '.channels | length') -ge 3 ]; then
exit 0
else
lncli openchannel --node_key=$ROUTER_LND_PUBKEY --connect router_lnd:9735 --sat_per_vbyte 1 \\