Skip to content

usablebalances should list all channels #1741

@contrebande-labs

Description

@contrebande-labs

Currently (0.5.1), usablebalances will not list a channel which is disabled as per the channelFlags in the outgoing/payable direction (and maybe under other circumstances that we have not been made aware of). Furthermore, we have been told by @t-bast that the canReceive and canSend values from the usablebalances result can be strictly positive (more than zero) even if the channel is disabled in the respective direction.

We think that unless the LN spec semantics suggest otherwise, all channels should be listed in the result for the usablebalances command, regardless of their incoming or outgoing balances and wether or not they are disabled in any direction for wathever reasons. Furthermore, if a channel is somehow disabled in a direction or in both directions, the respective canReceive and canReceive values should be set to zero (0), regardless of the actual balances, because that's what the "can" in canReceive and canSend means in natural language.

The first bug here is that If your node has a channel with only an incoming balance, that channel will not appear in the usablebalances API call result where it should. The second bug is that a disabled channel could appear with a non-null balance in its canReceive or canSend field.

Any node with a channel with only an incoming balances can reproduce the issue.

We are using eclair 0.5.1 pre-compiled, downloaded from Github.

The OS is Ubuntu 20.04, the JRE is AdoptOpenJDK 11.0.10.

We were asked to produce a bug report for this issue by @t-bast following a private Gitter conversation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions