We used to only probe for a 10sat amount, which allows us to test
basic reachability, but it doesn't say much about whether we can
actually pay for something reasonable, so this fixes that.
This may require the following SQL statement to be applied to the
database if you are upgrading from a prior version:
```sql
ALTER TABLE probes ADD amount INTEGER;
```
This is not required if you start with a new database.
Add two optional arguments to `backup-cli server`:
- `--log-mode`: either `plain` (simply print the log message) or `systemd`
(prefix log message with systemd log level, useful for running as a
a service)
- `--log-level`: minimum level for messages to be logged, from `DEBUG`
to `CRITICAL`
Also, move some noisy messages to the debug level.
root@ubuntu-s-4vcpu-8gb-nyc3-01:~# l2-cli currencyrates USD
{
"code": -32600,
"message": "Error while processing currencyrates: argument of type 'int' is not iterable",
"traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.8/dist-packages/pyln/client/plugin.py\", line 621, in _dispatch_request\n result = self._exec_func(method.func, request)\n File \"/usr/local/lib/python3.8/dist-packages/pyln/client/plugin.py\", line 603, in _exec_func\n return func(*ba.args, **ba.kwargs)\n File \"/root/plugins/currencyrate/currencyrate.py\", line 121, in currencyrates\n return get_rates(plugin, currency.upper())\n File \"/usr/local/lib/python3.8/dist-packages/cachetools/decorators.py\", line 22, in wrapper\n v = func(*args, **kwargs)\n File \"/root/plugins/currencyrate/currencyrate.py\", line 110, in get_rates\n r = get_currencyrate(plugin, currency, s.urlformat, s.replymembers)\n File \"/root/plugins/currencyrate/currencyrate.py\", line 71, in get_currencyrate\n r = requests_retry_session(retries=5, status_forcelist=(404)).get(url, proxies=plugin.proxies)\n File \"/usr/lib/python3/dist-packages/requests/sessions.py\", line 543, in get\n return self.request('GET', url, **kwargs)\n File \"/usr/lib/python3/dist-packages/requests/sessions.py\", line 530, in request\n resp = self.send(prep, **send_kwargs)\n File \"/usr/lib/python3/dist-packages/requests/sessions.py\", line 643, in send\n r = adapter.send(request, **kwargs)\n File \"/usr/lib/python3/dist-packages/requests/adapters.py\", line 439, in send\n resp = conn.urlopen(\n File \"/usr/lib/python3/dist-packages/urllib3/connectionpool.py\", line 803, in urlopen\n if retries.is_retry(method, response.status, has_retry_after):\n File \"/usr/lib/python3/dist-packages/urllib3/util/retry.py\", line 339, in is_retry\n if self.status_forcelist and status_code in self.status_forcelist:\nTypeError: argument of type 'int' is not iterable\n"
}
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
A channel can exist without a short_channel_id, in the CHANNELD_AWAITING_LOCKIN state, while the funding transaction is sent but not yet included in a block.
Running `rebalanceall` while opening a channel could throw an exception:
```
2021-02-14T09:31:39 UNUSUAL plugin-rebalance.py: Exception in thread Thread-5:
2021-02-14T09:31:39 UNUSUAL plugin-rebalance.py: Traceback (most recent call last):
2021-02-14T09:31:39 UNUSUAL plugin-rebalance.py: File \"/usr/lib/python3.6/threading.py\", line 916, in _bootstrap_inner
2021-02-14T09:31:39 UNUSUAL plugin-rebalance.py: self.run()
2021-02-14T09:31:39 UNUSUAL plugin-rebalance.py: File \"/usr/lib/python3.6/threading.py\", line 864, in run
2021-02-14T09:31:39 UNUSUAL plugin-rebalance.py: self._target(*self._args, **self._kwargs)
2021-02-14T09:31:39 UNUSUAL plugin-rebalance.py: File \"/home/user/plugins/rebalance/rebalance.py\", line 475, in rebalanceall_thread
2021-02-14T09:31:39 UNUSUAL plugin-rebalance.py: result = maybe_rebalance_once(plugin, failed_pairs)
2021-02-14T09:31:39 UNUSUAL plugin-rebalance.py: File \"/home/user/plugins/rebalance/rebalance.py\", line 443, in maybe_rebalance_once
2021-02-14T09:31:39 UNUSUAL plugin-rebalance.py: result = maybe_rebalance_pairs(plugin, ch1, ch2, failed_pairs)
2021-02-14T09:31:39 UNUSUAL plugin-rebalance.py: File \"/home/user/plugins/rebalance/rebalance.py\", line 425, in maybe_rebalance_pairs
2021-02-14T09:31:39 UNUSUAL plugin-rebalance.py: wait_for_htlcs(plugin, [scid1, scid2])
2021-02-14T09:31:39 UNUSUAL plugin-rebalance.py: File \"/home/user/plugins/rebalance/rebalance.py\", line 384, in wait_for_htlcs
2021-02-14T09:31:39 UNUSUAL plugin-rebalance.py: if scids is not None and channel['short_channel_id'] not in scids:
2021-02-14T09:31:39 UNUSUAL plugin-rebalance.py: KeyError: 'short_channel_id'
```
Support the bracketed `socket:[::]:1234` syntax for IPv6 addresses.
Also, add factor out the socket URI parsing to a function and add
tests for it. As a forward compatibility measure, reject query strings
(`?a=b`) because I intend to use these for parameters such as SOCKS5
proxy (for Tor) in a future patch.
Additional checking was added that a file exists when `create=False`,
this runs into an error with the `test_rewrite()` test. Update the test
to use dummy backend for the test, as it tests a method on the base
class, not any specific backend.
This is a rather long option, and if `lightning-cli` is configured
correctly we should be able to extract this information directly from
it without problems. This adds auto-discovery based on `lightning-cli`
which will to the right thing™