Clarify connected-mirror comment and pin the fixture rune path

Address review F7/F8 on #1625:

F7 (verification): the onchain.ts `connected === false` branch reads /v1/listfunds
(CLN's own connected field) and only buckets balance as inactive — it is not the
listPeerChannels mirror and does no close logic, so the coercion activates nothing
there. Reword the mirror comment, which inaccurately implied onchain.ts consumes it;
the mirror simply keeps the documented backward-compat `connected` field defined.

F8: hardcode the rune path in create-rune.sh to /root/.lightning/rtl.rune so it
matches the volume mount, healthcheck and RTL runePath instead of deriving it from
${LIGHTNINGD_DATA}, removing the silent-divergence risk.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
saubyk 2026-07-17 12:12:05 -07:00 committed by Suheb
parent cbf7a14c95
commit f518488ecb
2 changed files with 9 additions and 4 deletions

View file

@ -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');
});