diff --git a/docker/cln/create-rune.sh b/docker/cln/create-rune.sh index b288cf17..3fd3e3d1 100755 --- a/docker/cln/create-rune.sh +++ b/docker/cln/create-rune.sh @@ -11,7 +11,12 @@ # format RTL reads via its runePath. POSIX sh compatible. set -u -RUNE_FILE="${LIGHTNINGD_DATA}/rtl.rune" +# Hardcoded to match the single source of truth used everywhere else in the fixture: +# the cln volume mount (cln_data:/root/.lightning), the healthcheck's `test -f`, and +# RTL's runePath (/cln/rtl.rune, /cln being cln_data mounted read-only). Keep these in +# lockstep — do not switch to ${LIGHTNINGD_DATA}, which would silently diverge if the +# image's data dir ever changed while the mounts/healthcheck stayed on /root/.lightning. +RUNE_FILE="/root/.lightning/rtl.rune" [ -f "${RUNE_FILE}" ] && exit 0 diff --git a/server/controllers/cln/channels.ts b/server/controllers/cln/channels.ts index bf3c6166..4a68624e 100644 --- a/server/controllers/cln/channels.ts +++ b/server/controllers/cln/channels.ts @@ -22,9 +22,9 @@ export const listPeerChannels = (req, res, next) => { channel.to_them_msat = channel.total_msat - channel.to_us_msat; channel.balancedness = (channel.total_msat === 0) ? 1 : (1 - Math.abs((channel.to_us_msat - channel.to_them_msat) / channel.total_msat)).toFixed(3); // listpeerchannels reports connection state as peer_connected. Mirror it onto the - // legacy 'connected' field so backward-compat consumers stay in sync (issue #1606). - // Coerce to a real boolean so strict-equality readers (e.g. onchain.ts's - // connected === false) behave correctly even when peer_connected is absent. + // documented legacy 'connected' field (see the Channel model) as a real boolean, so + // any backward-compat consumer of this endpoint gets a defined true/false rather than + // undefined when peer_connected is absent (issue #1606). channel.connected = !!channel.peer_connected; return getAlias(req.session.selectedNode, channel, 'peer_id'); });