ZmnSCPxj jxPCSnmZ
a437936c78
lightningd/log.c: Fix up handling of SIGHUP.
Fixes : #4240
ChangeLog-Fixed: log: Do not terminate on the second received SIGHUP.
4 years ago
ZmnSCPxj jxPCSnmZ
67d8fdcc75
tests/test_misc.py: Add a test for issue #4240 .
4 years ago
niftynei
4185a86d90
df-mfc: set the minimum input weight to 110 iif v2
We only need a bumped up input weight if we're talking to nodes that
require v2.
4 years ago
niftynei
b01734087d
df-mfc: set protocol type when we know it
We'll use it for figuring out whether or not to set a utxo witness
minimum, which comes much before we were setting this field.
Now we set the protocol as soon as we can reasonably deduce it.
4 years ago
niftynei
e81d78ec4c
fundpsbt/utxopsbt: new `min_witness_weight` param
Needed for v2 of channel opens, where the minimum weight is 110; a
'simple utxo' (sig + key) weighs in at 107, so we a need a way to
establish a floor for this case.
Changelog-Added: JSON-RPC: fundpsbt/utxopsbt have new param, `min_witness_utxo`, which sets a floor for the weight calculation of an added input
4 years ago
niftynei
b4aebc17a1
bitcoin: break out method to calculate input weight
We have a required minimum witness weight for dual funded opens.
4 years ago
niftynei
b23c6c50a0
df-tests: use multifundchannel pathways instead of custom plugin
Since fundchannel/multifundchannel now handles v2 opens, we use that
instead of this hacked together plugin.
4 years ago
niftynei
9f74dd9fb3
df: rename the dual_open wires to match other daemon wires
4 years ago
Rusty Russell
0ad269f5b6
invoice: make invoice_payment hook a multi-user hook.
We register on it for offers, and without this nobody else can.
Changelog-Changed: plugins: more than one plugin can now register invoice_payment hook.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
4 years ago
Rusty Russell
ca2bd98082
unittest: use common_setup / common_shutdown almost everywhere.
Avoids much cut & paste. Some tests don't need any of it, but most
want at least some of this infrastructure.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
4 years ago
Rusty Russell
39f4ca98b5
common: check for outstanding taken() pointers in common_shutdown.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
4 years ago
Rusty Russell
ae1a130ab5
ccan: update ccan/utf-8 to reject NULs embedded in strings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
4 years ago
Rusty Russell
c29e290ee6
common/json: json_add_stringn helper.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
4 years ago
Rusty Russell
9361b62e3a
libplugin: add command_hook_success helper.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
4 years ago
Rusty Russell
d9586bbde1
json: add json_tok_endswith and json_tok_startswith helpers.
I wanted this for offers, and it's generally useful.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
4 years ago
Rusty Russell
3408f8f998
gossipd: fix memleak.
Not really a leak, since we eventually process pending, but still:
```
**BROKEN** gossipd: MEMLEAK: 0x5562fa63bab8
**BROKEN** gossipd: label=wire/peer_exp_wiregen.c:3858:u8[]
DEBUG gossipd: backtrace:
DEBUG gossipd: ccan/ccan/tal/tal.c:442 (tal_alloc_)
DEBUG gossipd: ccan/ccan/tal/tal.c:471 (tal_alloc_arr_)
DEBUG gossipd: wire/peer_exp_wiregen.c:3858 (fromwire_channel_announcement)
DEBUG gossipd: gossipd/routing.c:1706 (handle_channel_announcement)
DEBUG gossipd: gossipd/gossipd.c:238 (handle_channel_announcement_msg)
DEBUG gossipd: gossipd/gossipd.c:444 (peer_msg_in)
DEBUG gossipd: common/daemon_conn.c:31 (handle_read)
DEBUG gossipd: ccan/ccan/io/io.c:59 (next_plan)
DEBUG gossipd: ccan/ccan/io/io.c:407 (do_plan)
DEBUG gossipd: ccan/ccan/io/io.c:417 (io_ready)
DEBUG gossipd: ccan/ccan/io/poll.c:445 (io_loop)
DEBUG gossipd: gossipd/gossipd.c:1730 (main)
**BROKEN** gossipd: parents:
**BROKEN** gossipd: gossipd/routing.c:1698:struct pending_cannouncement
**BROKEN** gossipd: gossipd/gossipd.c:1700:struct daemon
```
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
4 years ago
Rusty Russell
25fcc4ddbf
Makefile: separate check-python targets.
There's a 60 second delay in one of the contrib tests, and I just want
to run flake8 on my alterations.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
4 years ago
Rusty Russell
f0621cec0d
JSON-RPC: don't allow any strings which aren't valid UTF-8.
We already do some sanity checks, add this one.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Changed: JSON-RPC: invalid UTF-8 strings now rejected.
4 years ago
Rusty Russell
5bdd282c2b
common/bolt11: reject bad UTF-8 strings.
We don't have a problem with them, but callers may; easier to reject bad
UTF8 here than let the caller fail when it tries to parse output.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
4 years ago
Rusty Russell
f1bea50e1d
common/utils: simple utf8 helpers.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
4 years ago
Michael Schmoock
7bfb5f10c7
pyln: failing test msat from float str
We were not able to create pyln Millisatoshi from floats, e.g.:
- "0.01btc"
- "0.1sat"
- ...
This adds a test that makes sure this won't happen again.
4 years ago
Michael Schmoock
83a21138b8
pyln: fix msat from float str
Changelog-fixed: pyln: parsing msat from a float string
4 years ago
Michael Schmoock
899022e452
pytest: use default fundamount on two tests
4 years ago
Michael Schmoock
bdad9fcdd9
pyln: def amount 10**6 for fund- and openchannel
Changelog-None
4 years ago
Rusty Russell
68c6ae67b3
external/Makefile: fix parallel build with missing secp headers.
Fixes : #4229
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
4 years ago
ZmnSCPxj jxPCSnmZ
32de621886
lightningd/plugin_hook.c: Make `db_write` a chained hook.
Fixes : #4219
Changelog-Changed: Plugins: Multiple plugins can now register `db_write` hooks.
4 years ago
ZmnSCPxj jxPCSnmZ
904e110554
lightningd/plugin.c: Make plugin-exclusive loop support multiple plugins.
4 years ago
Jon Griffiths
5c2fc4c1cb
wally: remove wally casts that are no longer needed
Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
4 years ago
Jon Griffiths
5bdad04976
tx: Remove wally workaround that is no longer needed
Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
4 years ago
Rusty Russell
70977a4fbd
libwally: update to latest which uses libsecp-zkp submodule
And get rid of the now-obsolete PYTHON_VERSION hack.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
4 years ago
niftynei
5e71de7819
df-spec: fail the open if they send us too many tx-collab msgs
4 years ago
niftynei
29c3532856
mfc-psbt: mark all of our inputs as "ours", then only sign those
we only want to sign the inputs that we've reserved via utxopsbt or
fundpsbt. we mark them with a flag (reusing the now defunct max-len
flag is fine), then look for inputs with that flag to pass to signonly
4 years ago
niftynei
6077eca660
df: pass back 'close_to' for completed/commitment secured channels
When commitments are secured, also return the 'close_to' script if we've
got a local_upfront_shutdown_script set.
4 years ago
niftynei
405453859c
mfc-df: add 'happy path' tests for the v1+v2 things
We can't test disconnects et.al. quite yet because the 'cancel' flow for
openchannelv2 still needs to be resolved
4 years ago
niftynei
da98a9d0af
df-accepter plugin: temporarily dont pass in signpsbt
4 years ago
niftynei
c6b45e052b
mfc-df: after openchannel_signed is finished, we call finished
We done!?
4 years ago
niftynei
3e19b6c8f5
mfc-df: after psbt signed, send to openchannel_signed if v2s
If there's an v2 destinations, they'll broadcast the tx for us
4 years ago
niftynei
a34425abd1
mfc-df: after sigs are collected, go sign the psbt
4 years ago
niftynei
d7c06b5b0e
mfc-df: once we've gotten the PSBT finalized, we wait for peer sigs
We need our peer's signatures to arrive before we sign/broadcast the
funding transaction (but only if there's v2 peers present)
4 years ago
niftynei
c90a19f739
mfc-df: only add outputs for v1 outs; go to openchannel_update if v2s
We only have output scripts for v1 protocols after the
fundchannel_start/openchannel_init round. We need to add them before
we get into the openchannel_update rounds, however, so we do that here.
4 years ago
niftynei
3d2c0951d5
mfc-df: rework how openchannel_update works, callbacks
4 years ago
niftynei
381658dee6
mfc-df: merge openchannel_init/fundchannel_start results
These happen simultaneously, and should resolve to the same place when
they're finished.
4 years ago
niftynei
95de8b1174
mfc-df: have both paths use redo_multifundchannel
Still need handling of failure for v2 opens (no rpc exists?!)
4 years ago
niftynei
a31b078721
mfc: consolidate to a single FAILED state
4 years ago
niftynei
991ae65e9e
mfc-df: track destination's openchannel version
Plus method to help count/tabulate how many of each we've got
around still.
4 years ago
niftynei
e0c4865eea
mfc: add a 'fail_destination' helper
Caches state at which we failed + sets error
4 years ago
niftynei
5b6b012af9
mfc: add happy path-way for v2 in multifundchannel
Tested and works with both sides funding! Yay.
Doesn't do any amount of reasonable cleanup or handling of errors.
4 years ago
niftynei
78d32b12d0
nit,df test plugin: change up how feerate is formatted
Suggested-by: @cdecker
4 years ago
ZmnSCPxj jxPCSnmZ
ff090ecfe6
doc/TOR.md: Add missing instructions to add user to Tor group.
Changelog-None
Fixes : #4208
4 years ago
niftynei
e4cd5eac28
htlc.h: move NUM_SIDES to define, not enum member
4 years ago