mirror of
https://github.com/aljazceru/plugins.git
synced 2025-12-24 08:34:18 +01:00
summary: sort output by scid per default
The sort order got changed to random(?) I think when cln changed to have multiple channels per peer supprt. This restores the old sort by scid order, which is nice since old channels are upfront. Maybe we can add other orderings in later commits by copfig options and `summary` method paramters.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
from pyln.client import Plugin, Millisatoshi
|
||||
from packaging import version
|
||||
from collections import namedtuple
|
||||
from operator import attrgetter
|
||||
from summary_avail import trace_availability, addpeer
|
||||
import pyln.client
|
||||
import requests
|
||||
@@ -180,7 +181,8 @@ def summary(plugin, exclude=''):
|
||||
reply['avail_in'] += ' ({})'.format(to_fiatstr(avail_in))
|
||||
reply['fees_collected'] += ' ({})'.format(to_fiatstr(info['fees_collected_msat']))
|
||||
|
||||
if chans != []:
|
||||
if len(chans) > 0:
|
||||
chans = sorted(chans, key=attrgetter('scid'))
|
||||
reply['channels_flags'] = 'P:private O:offline'
|
||||
reply['channels'] = ["\n"]
|
||||
biggest = max(max(int(c.ours), int(c.theirs)) for c in chans)
|
||||
|
||||
Reference in New Issue
Block a user