Skip to content

Add channelbalances API call#2196

Merged
remyers merged 5 commits into
ACINQ:masterfrom
remyers:channelbalances
Mar 29, 2022
Merged

Add channelbalances API call#2196
remyers merged 5 commits into
ACINQ:masterfrom
remyers:channelbalances

Conversation

@remyers
Copy link
Copy Markdown
Contributor

@remyers remyers commented Mar 1, 2022

Solves issue #1741 by adding a new API call channelbalances. This API lists all channel balances, including balances from disabled channels. Channels with zero canSend balance that are not shown by usablebalances can instead be seen with channelbalances.

@remyers
Copy link
Copy Markdown
Contributor Author

remyers commented Mar 1, 2022

@t-bast How should I document this new call in the API documentation? should documentation be part of this PR too?

@remyers remyers requested a review from t-bast March 1, 2022 16:03
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Merging #2196 (ba3a511) into master (068b139) will increase coverage by 0.00%.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##           master    #2196   +/-   ##
=======================================
  Coverage   83.88%   83.89%           
=======================================
  Files         186      186           
  Lines       13920    13917    -3     
  Branches      553      580   +27     
=======================================
- Hits        11677    11675    -2     
+ Misses       2243     2242    -1     
Impacted Files Coverage Δ
...r-core/src/main/scala/fr/acinq/eclair/Eclair.scala 50.27% <0.00%> (-0.29%) ⬇️
...cala/fr/acinq/eclair/payment/relay/NodeRelay.scala 95.93% <0.00%> (-1.63%) ⬇️
...c/main/scala/fr/acinq/eclair/channel/Helpers.scala 95.20% <0.00%> (-0.03%) ⬇️
...c/main/scala/fr/acinq/eclair/channel/Channel.scala 87.89% <0.00%> (+0.06%) ⬆️
...main/scala/fr/acinq/eclair/io/PeerConnection.scala 85.98% <0.00%> (+0.37%) ⬆️
...clair/channel/publish/ReplaceableTxPublisher.scala 74.17% <0.00%> (+1.32%) ⬆️

@remyers remyers self-assigned this Mar 2, 2022
@remyers remyers marked this pull request as ready for review March 18, 2022 09:14
@remyers remyers changed the title add channelbalances API call Add channelbalances API call Mar 25, 2022
@remyers
Copy link
Copy Markdown
Contributor Author

remyers commented Mar 25, 2022

@t-bast How should I document this new call in the API documentation? should documentation be part of this PR too?

I'll add to the release notes the new channelbalances documentation so @t-bast can update the API docs when 0.71 is released.

Comment thread eclair-core/src/main/scala/fr/acinq/eclair/Eclair.scala Outdated
Comment thread eclair-core/eclair-cli
Comment thread eclair-node/src/test/scala/fr/acinq/eclair/api/ApiServiceSpec.scala Outdated
t-bast
t-bast previously approved these changes Mar 28, 2022
Copy link
Copy Markdown
Member

@t-bast t-bast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just needs a rebase!

canReceive = commitments.availableBalanceForReceive,
isPublic = commitments.announceChannel)
isPublic = commitments.announceChannel,
isEnabled = channelUpdate.channelFlags.isEnabled)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually there is a subtlety here: isEnabled only applies to our side of the channel, there is a separate channel_update for the other direction (our peer -> us).

Ideally we would expose two bools: sendEnabled and receiveEnabled (our current isEnabled is actually sendEnabled) to have the most accurate data. However the relayer only keeps our own channe_ update, not our peer's channel_update (because we only want to know if we can send, we don't care about receiving).

I really don't think it's worth fixing, unless someone has a very compelling use-case for it, but I thought it was interesting to raise the point.

Copy link
Copy Markdown
Member

@t-bast t-bast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@remyers remyers merged commit 9358e5e into ACINQ:master Mar 29, 2022
t-bast added a commit that referenced this pull request Dec 1, 2022
The release introduces a few API changes:

- channelbalances retrieves information about the balances of all local
  channels (#2196)
- channelbalances and usablebalances return a shortIds object instead
  of a single shortChannelId (#2323)
- stop stops eclair: please note that the recommended way of stopping
  eclair is simply to kill its process (#2233)
- rbfopen lets the initiator of a dual-funded channel RBF the funding
  transaction (#2275)
- listinvoices and listpendinginvoices now accept --count and --skip
  parameters to limit the number of retrieved items (#2474)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants