servo: clightning-sane: handle closed channels in status listing
This commit is contained in:
parent
432170a69e
commit
0c72c59190
|
@ -394,9 +394,13 @@ def show_status(rpc: RpcHelper, full: bool=False):
|
||||||
"""
|
"""
|
||||||
show a table of channel balances between peers.
|
show a table of channel balances between peers.
|
||||||
"""
|
"""
|
||||||
for ch in rpc.rpc.listpeerchannels()["channels"]:
|
for peerch in rpc.rpc.listpeerchannels()["channels"]:
|
||||||
ch = rpc.localchannel(ch["short_channel_id"])
|
try:
|
||||||
print(ch.to_str(with_scid=True, with_bal_ratio=True, with_cost=True, with_ppm_theirs=True, with_ppm_mine=full))
|
ch = rpc.localchannel(peerch["short_channel_id"])
|
||||||
|
except:
|
||||||
|
print(f"{peerch['peer_id']} scid:{peerch['short_channel_id']} state:{peerch['state']} NO CHANNELS")
|
||||||
|
else:
|
||||||
|
print(ch.to_str(with_scid=True, with_bal_ratio=True, with_cost=True, with_ppm_theirs=True, with_ppm_mine=full))
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
logging.basicConfig()
|
logging.basicConfig()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user