We were double counting channel lease fees because we were double firing
the channel open event sequence (so to speak). If we don't report
balances for unopened channels, we don't have this problem?
Changelog-Changed: Plugins: `balance_snapshot` notification does not send balances for channels that aren't locked-in/opened yet
Reproduce crash for #5557!
If we record the channel open because bookkeeper was added after the
channel open request started but the channel confirms later, we end up
with re-recording any associated push or leased fees (paid or rcvd).
In the case where you've paid for these fees, your channel balance goes
negative and the node crashes the next time you call `listbalances`.
Reported-by: @chrisguida
Be more graceful in shutting down: this should fix the issue where
bookkeeper gets upset that its commands are rejected during shutdown,
and generally make things more graceful.
1. Stop any new RPC connections.
2. Stop any per-peer daemons (channeld, etc).
3. Shut down plugins.
4. Stop all existing RPC connections.
5. Stop global daemons.
6. Free up peer, chanen HTLC datastructures.
7. Close database.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Changed: Plugins: RPC operations are now still available during shutdown.
Because it used internal routines, it didn't pass operations through the
db hook! So make it use the generic routines, with the twist that they
are not translated.
And when we use this in a migration hook, we're actually in a
transaction.
This, in turn, introduces an issue: we need to be outside a transaction
to "PRAGMA foreign_keys = OFF", but completing the transaction when
there is a db hook actually enters the io loop, freeing the tmpctx!
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This broke with COPTFLAGS="-flto -O3", and so I took a look (it
complains more than normal because main isn't there). We should never
be running update-mocks except on programs expected to compile: in
this case, that's tools/test/run-test-wire.c.
Remove the code which tries to run this, which also means
non-developers won't be running update-mocks!
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This includes the recommendation that we use 10 minute grace period,
so add quotes to where we use that.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This alters the billboard, but that's a human-readable thing so not
noted in CHANGELOG.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Changed: JSON-RPC: `listpeers` `status` now refers to "channel ready" rather than "funding locked" (BOLT language change for zeroconf channels)
Changelog-Added: JSON-RPC: `channel_opened` notification `channel_ready` flag.
Changelog-Deprecated: JSON-RPC: `channel_opened` notification `funding_locked` flag (use `channel_ready`: BOLTs namechange).
This contains the zeroconf stuff, with funding_locked renamed to
channel_ready. I change that everywhere, and try to fix up the
comments.
Also the `alias` field is called `short_channel_id`.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Changed: Protocol: `funding_locked` is now called `channel_ready` as per latest BOLTs.
This would be more effective if we didn't *merge* in the specs repo,
but still.
Usage: ./devtools/bolt-catchup.sh
It goes through one commit at a time, up to current HEAD, and stops when there
are changes, or quotes change.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Removed: `hsmtool`: hsm_secret (ignored) on cmdline for dumponchaindescriptors (deprecated in v0.9.3)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
It was deprecated in v0.10.1, but only one channel on the network
doesn't set it now anyway, and we'll be ignoring that soon.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
We can do this now the function is cleaned up.
Always better to do the work inside param() since then `check`
gets the benefit.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Removed: Old order of the `status` parameter in the `listforwards` rpc command (deprecated in v0.10.2)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Removed: JSONRPC: RPC framework now requires the `"jsonrpc"` property inside the request (deprecated in v0.10.2)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Somehow we missed this deprecation, found by grep.
Changelog-Removed: JSON API: Removed double wrapping of `rpc_command` payload in `rpc_command` JSON field (deprecated v0.8.2)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This FIXME caught my eye, as it's wrong: TLVs are canonical, so they cannot
differ in bits and be equal.
The equality function needs to be written correctly, however, otherwise it
will crash!
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Currently discovered IPs are only announced when we don't have any
usable addresses detected or configured already. However, the cli
command `getinfo` still showed theses unannounced addr as if they
were announced.
Changelog-Fixed: peer_control: getinfo showing unannounced addresses.
Requires us to update to latest lnproto which is now using the most up
to date python-bitcoinlib, as well as updating our python lock files
(which pin the grpcio deps, because of locking problems h/t @cdecker)
If there's only a single underscore, lowdown ignores it, but if there are multiple
(see min_final_cltv_expiry) it decides we're trying to highlight part of the word.
Reported-by: @wtogami
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1. If the tool changes, you need to regenerate since the output may
change.
2. This didn't just filter that out, ignored all but the first
dependency, which made bisecting the bookkeeper plugin a nightmare:
it didn't regenerate the .po file, causing random crashes.
If we want this, try $(filter-out tools/fromschema.py) instead. But I
don't think we want that.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
You can't start a list without a paragraph separator.
```diff
--- /tmp/before 2022-07-20 22:02:23.485372596 +0930
+++ /tmp/after 2022-07-20 22:02:33.745528456 +0930
@@ -21,12 +21,16 @@
On startup of the daemon, no autoclean is set up.
RETURN VALUE
- On success, an object is returned, containing: - enabled (boolean):
- whether invoice autocleaning is active
+ On success, an object is returned, containing:
- If enabled is true: - expired_by (u64): how long an invoice must be ex‐
- pired (seconds) before we delete it - cycle_seconds (u64): how long an
- invoice must be expired (seconds) before we delete it
+ • enabled (boolean): whether invoice autocleaning is active
+
+ If enabled is true:
+
+ • expired_by (u64): how long an invoice must be expired (seconds) be‐
+ fore we delete it
+ • cycle_seconds (u64): how long an invoice must be expired (seconds)
+ before we delete it
AUTHOR
ZmnSCPxj <ZmnSCPxj@protonmail.com> is mainly responsible.
```
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
There are no definition lists in Markdown, and lists get mangled if
they follow immediately: they need a line between them.
So use bullets for options, and use an indent so the text gets in the
line below.
Here's a before-and-after example:
```diff
--- /tmp/after 2022-07-20 21:55:54.355487769 +0930
+++ /tmp/after2 2022-07-20 21:58:17.305642576 +0930
@@ -10,38 +10,71 @@
lightning-cli sends commands to the lightning daemon.
OPTIONS
- --lightning-dir=DIR Set the directory for the lightning daemon we're talking to; defaults to $HOME/.lightning.
+ • --lightning-dir=DIR
- --conf=PATH Sets configuration file (default: lightning-dir/config ).
+ Set the directory for the lightning daemon we're talking to; defaults to $HOME/.lightning.
- --network=network --mainnet --testnet --signet Sets network explicitly.
+ • --conf=PATH
- --rpc-file=FILE Named pipe to use to talk to lightning daemon: default is lightning-rpc in the lightning directory.
+ Sets configuration file (default: lightning-dir/config ).
- --keywords/-k Use format key=value for parameters in any order
+ • --network=network
- --order/-o Follow strictly the order of parameters for the command
+ • --mainnet
- --json/-J Return result in JSON format (default unless help command, or result contains a format-hint field).
+ • --testnet
- --raw/-R Return raw JSON directly as lightningd replies; this can be faster for large requests.
+ • --signet
- --human-readable/-H Return result in human-readable output.
+ Sets network explicitly.
- --flat/-F Return JSON result in flattened one-per-line output, e.g. { "help": [ { "command": "check" } ] } would become
+ • --rpc-file=FILE
+
+ Named pipe to use to talk to lightning daemon: default is lightning-rpc in the lightning directory.
+
+ • --keywords/-k
+
+ Use format key=value for parameters in any order
+
+ • --order/-o
+
+ Follow strictly the order of parameters for the command
+
+ • --json/-J
+
+ Return result in JSON format (default unless help command, or result contains a format-hint field).
+
+ • --raw/-R
+
+ Return raw JSON directly as lightningd replies; this can be faster for large requests.
+
+ • --human-readable/-H
+
+ Return result in human-readable output.
+
+ • --flat/-F
+
+ Return JSON result in flattened one-per-line output, e.g. { "help": [ { "command": "check" } ] } would become
help[0].command=check. This is useful for simple scripts which want to find a specific output field without parsing
JSON.
- --notifications/-N=LEVEL If LEVEL is 'none', then never print out notifications. Otherwise, print out notifications of
- LEVEL or above (one of io, debug, info (the default), unusual or broken: they are prefixed with # .
+ • --notifications/-N=LEVEL
+
+ If LEVEL is 'none', then never print out notifications. Otherwise, print out notifications of LEVEL or above (one of
+ io, debug, info (the default), unusual or broken: they are prefixed with # .
+
+ • --help/-h
+
+ Pretty-print summary of options to standard output and exit. The format can be changed using -F, -R, -J, -H etc.
+
+ • --version/-V
- --help/-h Pretty-print summary of options to standard output and exit. The format can be changed using -F, -R, -J, -H
- etc.
+ Print version number to standard output and exit.
- --version/-V Print version number to standard output and exit.
+ • allow-deprecated-apis=BOOL
- allow-deprecated-apis=BOOL Enable deprecated options. It defaults to true, but you should set it to false when testing to
- ensure that an upgrade won't break your configuration.
+ Enable deprecated options. It defaults to true, but you should set it to false when testing to ensure that an upgrade
+ won't break your configuration.
COMMANDS
lightning-cli simply uses the JSON RPC interface to talk to lightningd, and prints the results. Thus the commands avail‐
@@ -60,13 +93,13 @@
this is not encouraged.
EXAMPLES
- 1. List commands
+ 1. List commands:
- lightning-cli help
+ • lightning-cli help
- 2. Fund a 10k sat channel using uncomfirmed outputs
+ 2. Fund a 10k sat channel using uncomfirmed outputs:
- lightning-cli --keywords fundchannel id=028f...ae7d amount=10000sat minconf=0
+ • lightning-cli --keywords fundchannel id=028f...ae7d amount=10000sat minconf=0
BUGS
This manpage documents how it should work, not how it does work. The pretty printing of results isn't pretty.
```
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Here's the before-vs-after comparison (ignoring whitespace changes):
```diff
--- /tmp/before 2022-07-20 21:52:44.336641810 +0930
+++ /tmp/after 2022-07-20 21:55:54.355487769 +0930
@@ -1,7 +1,7 @@
-LIGHTNING-CLI(1) lightning-cli LIGHTNING-CLI(1)
+LIGHTNING-CLI(1) LIGHTNING-CLI(1)
NAME
- lightning-cli - Control lightning daemon
+ lightning-cli -- Control lightning daemon
SYNOPSIS
lightning-cli [OPTIONS] command
@@ -14,10 +14,7 @@
--conf=PATH Sets configuration file (default: lightning-dir/config ).
- --network=network
- --mainnet
- --testnet
- --signet Sets network explicitly.
+ --network=network --mainnet --testnet --signet Sets network explicitly.
--rpc-file=FILE Named pipe to use to talk to lightning daemon: default is lightning-rpc in the lightning directory.
@@ -43,8 +40,8 @@
--version/-V Print version number to standard output and exit.
- allow-deprecated-apis=BOOL Enable deprecated options. It defaults to true, but you should set it to false when testing
- to ensure that an upgrade won't break your configuration.
+ allow-deprecated-apis=BOOL Enable deprecated options. It defaults to true, but you should set it to false when testing to
+ ensure that an upgrade won't break your configuration.
COMMANDS
lightning-cli simply uses the JSON RPC interface to talk to lightningd, and prints the results. Thus the commands avail‐
@@ -67,7 +64,7 @@
lightning-cli help
- 1. Fund a 10k sat channel using uncomfirmed outputs
+ 2. Fund a 10k sat channel using uncomfirmed outputs
lightning-cli --keywords fundchannel id=028f...ae7d amount=10000sat minconf=0
@@ -84,4 +81,4 @@
Note: the modules in the ccan/ directory have their own licenses, but the rest of the code is covered by the BSD-style
MIT license.
- LIGHTNING-CLI(1)
+Core Lightning v0.11.0.1-350-gac2e137 LIGHTNING-CLI(1)
```
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Fixes: #5437
This happens with deprecated-apis and listconfigs, breaking some
python plugins!
Fixes: #5546Fixes: #5563
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>