Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Channel endpoint improvements (#199) #214

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
pre-commit-ci[bot] committed Mar 10, 2024
commit a87a5581eb14847d5e9b627b1352372ca5e81d14
8 changes: 5 additions & 3 deletions app/lightning/impl/lnd_grpc.py
Original file line number Diff line number Diff line change
@@ -909,9 +909,11 @@ async def channel_list(
self._lnd_stub.ListChannels(
ln.ListChannelsRequest(peer_alias_lookup=peer_alias_lookup)
),
self._lnd_stub.ClosedChannels(ln.ListChannelsRequest())
if include_closed
else None,
(
self._lnd_stub.ClosedChannels(ln.ListChannelsRequest())
if include_closed
else None
),
]
)

15 changes: 8 additions & 7 deletions app/lightning/models.py
Original file line number Diff line number Diff line change
@@ -586,13 +586,14 @@ def from_cln_jrpc(cls, c, peer_alias="") -> "Channel":
peer_publickey=c["peer_id"],
peer_alias=peer_alias,
balance_local=parse_cln_msat(c["to_us_msat"]) if "to_us_msat" in c else 0,
balance_remote=parse_cln_msat(c["total_msat"])
- parse_cln_msat(c["to_us_msat"])
if "total_msat" in c
else 0,
balance_capacity=parse_cln_msat(c["total_msat"])
if "total_msat" in c
else 0,
balance_remote=(
parse_cln_msat(c["total_msat"]) - parse_cln_msat(c["to_us_msat"])
if "total_msat" in c
else 0
),
balance_capacity=(
parse_cln_msat(c["total_msat"]) if "total_msat" in c else 0
),
initiator=ChannelInitiator.from_cln(c["opener"]),
closer=ChannelInitiator.from_cln(c["closer"]) if "closer" in c else None,
)
2 changes: 1 addition & 1 deletion app/system/router.py
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@
ConnectionInfo,
LoginInput,
RawDebugLogData,
SystemInfo,
SystemHealthInfo,
SystemInfo,
)
from app.system.service import (
HW_INFO_YIELD_TIME,