mirror of
https://github.com/aljazceru/plugins.git
synced 2025-12-23 16:14:20 +01:00
added fee per channel
Knowing the fee per channel is very useful for fee selection. I assume an option can be added to show the fees only if --details is an argument, but it will make the code a bit less clean.
This commit is contained in:
committed by
Christian Decker
parent
daff5ecd7a
commit
bcebb1ba2a
@@ -20,7 +20,7 @@ try:
|
|||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
Channel = namedtuple('Channel', ['total', 'ours', 'theirs', 'pid', 'private', 'connected', 'scid', 'avail'])
|
Channel = namedtuple('Channel', ['total', 'ours', 'theirs', 'pid', 'private', 'connected', 'scid', 'avail', 'base' ,'permil'])
|
||||||
Charset = namedtuple('Charset', ['double_left', 'left', 'bar', 'mid', 'right', 'double_right', 'empty'])
|
Charset = namedtuple('Charset', ['double_left', 'left', 'bar', 'mid', 'right', 'double_right', 'empty'])
|
||||||
if have_utf8:
|
if have_utf8:
|
||||||
draw = Charset('╟', '├', '─', '┼', '┤', '╢', '║')
|
draw = Charset('╟', '├', '─', '┼', '┤', '╢', '║')
|
||||||
@@ -85,7 +85,7 @@ def to_fiatstr(msat: Millisatoshi):
|
|||||||
# appends an output table header that explains fields and capacity
|
# appends an output table header that explains fields and capacity
|
||||||
def append_header(table, max_msat):
|
def append_header(table, max_msat):
|
||||||
short_str = Millisatoshi(max_msat).to_approx_str()
|
short_str = Millisatoshi(max_msat).to_approx_str()
|
||||||
table.append("%c%-13sOUT/OURS %c IN/THEIRS%12s%c SCID FLAG AVAIL ALIAS"
|
table.append("%c%-13sOUT/OURS %c IN/THEIRS%12s%c SCID FLAG BASE PERMIL AVAIL ALIAS"
|
||||||
% (draw.left, short_str, draw.mid, short_str, draw.right))
|
% (draw.left, short_str, draw.mid, short_str, draw.right))
|
||||||
|
|
||||||
|
|
||||||
@@ -152,7 +152,9 @@ def summary(plugin, exclude=''):
|
|||||||
c['private'],
|
c['private'],
|
||||||
p['connected'],
|
p['connected'],
|
||||||
c['short_channel_id'],
|
c['short_channel_id'],
|
||||||
plugin.persist['peerstate'][pid]['avail']
|
plugin.persist['peerstate'][pid]['avail'],
|
||||||
|
c['fee_base_msat'],
|
||||||
|
c['fee_proportional_millionths'],
|
||||||
))
|
))
|
||||||
|
|
||||||
if not active_channel and p['connected']:
|
if not active_channel and p['connected']:
|
||||||
@@ -210,7 +212,11 @@ def summary(plugin, exclude=''):
|
|||||||
else:
|
else:
|
||||||
extra += '_'
|
extra += '_'
|
||||||
s += '[{}] '.format(extra)
|
s += '[{}] '.format(extra)
|
||||||
|
|
||||||
|
# append fees
|
||||||
|
s += ' {:5}'.format(c.base.millisatoshis)
|
||||||
|
s += ' {:6} '.format(c.permil)
|
||||||
|
|
||||||
# append 24hr availability
|
# append 24hr availability
|
||||||
s += '{:4.0%} '.format(c.avail)
|
s += '{:4.0%} '.format(c.avail)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user