Skip to content

Commit

Permalink
Fix eclair-cli "compact" output
Browse files Browse the repository at this point in the history
"compact" mode (-s option) was broken after changes in how we manage short channel ids.
  • Loading branch information
sstone committed Jan 29, 2025
1 parent 73ea751 commit a55147a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eclair-core/eclair-cli
Original file line number Diff line number Diff line change
Expand Up @@ -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" ;;
Expand Down

0 comments on commit a55147a

Please sign in to comment.