From b57120091ab4e13e00b49818637821794d91af7d Mon Sep 17 00:00:00 2001 From: sstone Date: Wed, 29 Jan 2025 14:51:30 +0100 Subject: [PATCH 1/2] Fix eclair-cli "compact" output "compact" mode (-s option) was broken after changes in how we manage short channel ids. --- eclair-core/eclair-cli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eclair-core/eclair-cli b/eclair-core/eclair-cli index c69953ffeb..e517656706 100755 --- a/eclair-core/eclair-cli +++ b/eclair-core/eclair-cli @@ -155,7 +155,7 @@ jq_filter='if type=="object" and .error != null then .error else .'; # apply special jq filter if we are in "short" output mode -- only for specific commands such as 'channels' if [ "$short" = true ]; then - jq_channel_filter="{ nodeId, shortChannelId: .data.shortIds.real.realScid, channelId, state, commitments: (.data.commitments.active | map({balanceSat: (try (.localCommit.spec.toLocal / 1000 | floor) catch null), capacitySat: .fundingTx.amountSatoshis, fundingTxIndex: .fundingTxIndex, channelPoint: .fundingTx.outPoint})) }"; + jq_channel_filter="{ nodeId, shortChannelId: .data.shortIds.real, channelId, state, commitments: (.data.commitments.active | map({balanceSat: (try (.localCommit.spec.toLocal / 1000 | floor) catch null), capacitySat: .fundingTx.amountSatoshis, fundingTxIndex: .fundingTxIndex, channelPoint: .fundingTx.outPoint})) }"; case $api_endpoint in "channels") jq_filter="$jq_filter | map( $jq_channel_filter )" ;; "channel") jq_filter="$jq_filter | $jq_channel_filter" ;; From 053400e846dcd837359caf698de266f75f3d76c3 Mon Sep 17 00:00:00 2001 From: sstone Date: Tue, 11 Feb 2025 10:05:44 +0100 Subject: [PATCH 2/2] Get short channel id from last announcement --- eclair-core/eclair-cli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eclair-core/eclair-cli b/eclair-core/eclair-cli index e517656706..262cb4dce6 100755 --- a/eclair-core/eclair-cli +++ b/eclair-core/eclair-cli @@ -155,7 +155,7 @@ jq_filter='if type=="object" and .error != null then .error else .'; # apply special jq filter if we are in "short" output mode -- only for specific commands such as 'channels' if [ "$short" = true ]; then - jq_channel_filter="{ nodeId, shortChannelId: .data.shortIds.real, channelId, state, commitments: (.data.commitments.active | map({balanceSat: (try (.localCommit.spec.toLocal / 1000 | floor) catch null), capacitySat: .fundingTx.amountSatoshis, fundingTxIndex: .fundingTxIndex, channelPoint: .fundingTx.outPoint})) }"; + jq_channel_filter="{ nodeId, shortChannelId: .data.lastAnnouncement_opt.shortChannelId, channelId, state, commitments: (.data.commitments.active | map({balanceSat: (try (.localCommit.spec.toLocal / 1000 | floor) catch null), capacitySat: .fundingTx.amountSatoshis, fundingTxIndex: .fundingTxIndex, channelPoint: .fundingTx.outPoint})) }"; case $api_endpoint in "channels") jq_filter="$jq_filter | map( $jq_channel_filter )" ;; "channel") jq_filter="$jq_filter | $jq_channel_filter" ;;