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.
Sometimes when shelve gets updated, the binary format can differ
and result in first write errors on a re-opened db.
This tries to check for that and drop DB in this case.
This commit try to solve the following exception with an additional sanity check:
```
{
"code": -32600,
"message": "Error while processing summary: 'Plugin' object has no attribute 'persist'",
"traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.8/site-packages/pyln/client/plugin.py\", line 627, in _dispatch_request\n result = self._exec_func(method.func, request)\n File \"/usr/local/lib/python3.8/site-packages/pyln/client/plugin.py\", line 609, in _exec_func\n return func(*ba.args, **ba.kwargs)\n File \"/home/_lightning/plugins/summary.py\", line 124, in summary\n addpeer(plugin, p)\n File \"/var/git/plugins/summary/summary_avail.py\", line 7, in addpeer\n if pid not in p.persist['peerstate']:\nAttributeError: 'Plugin' object has no attribute 'persist'\n"
}
```
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
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.
using level error caused the testframework to fail on non-essential
price or availability thread log messages.
likely caused by the test runner not being able to query the bitstamp
API.
1. bitcoinaverage does not supply public prices since a while now:
> Unauthenticated requests are not allowed. Take out a new plan or start
> a free trial at https://pro.bitcoinaverage.com"
This commit fixes this by porting to bitstamp public ticker API.
2. This commit fixes the missing thread loop, so the price is
actually updated after a while.
3. This commit fixes an unchecked attribute access that crashed during
my tests.
* doc: cleanup and key-value for optional parameters
* rebalance: cleanup and refinements
* sendinvoiceless: cleanup and refinements
* summary: reflects upcoming changes of pylightning to_approx_str
* rebalance: check peer connection on local channels
When the summary plugin starts, it runs a thread to discover the current
`fiat_per_btc` price. When this was not finished yet, the `if` statement
in line 112 fails, because this in not JavaScript and the property has
to be checked with `hasattr(obj, key)` method in order to not throw an
exception.
Improves some minor output issues:
- Adds short channel id, so it can be copy and pasted for rebalancing
- renames `channels_key` to `channels_flags`
- changes flags round rackets (PO) to squace brackets [PO]
- Always outputs flags even if not set [__] so things are always aligned
- Removes the colon ':' and always prints a space
this also helps when copy and pasting in a terminal