Commit Graph

3060 Commits

Author SHA1 Message Date
Rusty Russell 0600aac68f lightningd: rename --no-reconnect to --dev-no-reconnect.
It's a dev option.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-02 00:05:00 +01:00
Rusty Russell bd3480dc9c lightningd: remember --log-file arg.
And fclose old ones if we get handed it multiple times.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-02 00:05:00 +01:00
Rusty Russell 7fd5808803 contrib/lightning-cli.bash-completion: fix for new simpler help format.
Plus, we don't need awk *and* sed for this!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-02 00:05:00 +01:00
Rusty Russell 7d18ef9ecf lightning-cli: human-readable printing for help.
And make it an option for now for other commands; consider making
it the default.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-02 00:05:00 +01:00
Rusty Russell 1ee44bdb47 jsonrpc: verbose help for help command.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-02 00:05:00 +01:00
Rusty Russell 27678dfe6a jsonrpc: add verbose help for individual commands.
And beg for contributions!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-02 00:05:00 +01:00
Rusty Russell 7f03e15e03 json_add_string_escape: for escaping internally-generated strings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-02 00:05:00 +01:00
cornwarecjp 6112df3a90 Bring back the time-out on the start-up of bitcoind, but make it 60 seconds instead of the original 10 seconds. This is much larger than the normal start-up time of bitcoind (so we should never hit the time-out), but still lets a test terminate in a reasonable time in the unlikely case that bitcoind hangs. 2018-02-01 23:00:43 +01:00
cornwarecjp 896f7ef37d Make it possible to run the test suite in Python 3.4 (bytes.hex was introduced in 3.5) 2018-02-01 23:00:43 +01:00
cornwarecjp 0b0708d86a Bitcoind should always eventually finish starting, but there is no guarantee on how long it takes, so don't apply a time-out. In case bitcoind hangs indefinitely, the test will hang indefinitely too, but this should be solved in bitcoind, not in the test code. 2018-02-01 23:00:43 +01:00
cornwarecjp 859070a5ed Terminate LightningD if, for some reason, it doesn't start properly. This cleans up the environment for future test runs. 2018-02-01 23:00:43 +01:00
cornwarecjp 71581ff96e Terminate BitcoinD if, for some reason, it doesn't start properly. This cleans up the environment for future test runs. 2018-02-01 23:00:43 +01:00
Rusty Russell 0cef23d33a check-spelling: don't paginate, and give file and line.
The pagination causes it to wait for a keypress even with no output
under emacs (complaining about the terminal); we don't want it anyway.

Example output:

Makefile:228:#lighnting!
Identified a likely misspelling of the word "lightning" (see above). Please fix.
Is this warning incorrect? Please teach tools/check-spelling.sh about the exciting new word.
Makefile:230: recipe for target 'check-spelling' failed

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-01 14:40:31 +01:00
Rusty Russell 8fcb45c1b2 routing: use marshalled short_channel_id, not string as tag for channel_announce
We use this technique for the other tags, so use it here too.

This was drawn to my attention when I made more than 10 channels in a
block, and the string changed length:

 Valgrind error file: valgrind-errors.31415
==31415== Conditional jump or move depends on uninitialised value(s)
==31415==    at 0x4C35E20: bcmp (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==31415==    by 0x11A624: queue_broadcast (broadcast.c:40)
==31415==    by 0x118D93: handle_pending_cannouncement (routing.c:704)
==31415==    by 0x1109E3: handle_txout_reply (gossip.c:1796)
==31415==    by 0x111177: recv_req (gossip.c:1955)
==31415==    by 0x136723: next_plan (io.c:59)
==31415==    by 0x137220: do_plan (io.c:387)
==31415==    by 0x13725E: io_ready (io.c:397)
==31415==    by 0x138B97: io_loop (poll.c:305)
==31415==    by 0x111352: main (gossip.c:2022)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-01 12:20:15 +01:00
Rusty Russell 3d91bf2ab8 closingd: use common/read_peer_msg.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-01 05:57:56 +00:00
Rusty Russell 89e8d26f45 openingd: use common/read_peer_msg.
We need to override the err_pkt handler, so we can tell the master
that it's just a current-channel negotiation failure.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-01 05:57:56 +00:00
Rusty Russell 6dee526074 channeld: don't handle packets already taken by peer_msg_in.
We will never see them.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-01 05:57:56 +00:00
Rusty Russell c69aee7d7a channeld: use common/read_peer_msg.
We need to override two methods: the io error (tell gossipd to
disable), and send reply (enqueue, don't write direclty).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-01 05:57:56 +00:00
Rusty Russell ef9b16399c common: read_peer_msg helpers for per-peer subds.
It's a bit ugly because each caller has slightly different needs, but
we have three hooks and standard helpers.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-01 05:57:56 +00:00
Rusty Russell bbdab02e1b bitcoind: trivial cleanups.
Remove commented-out code, and unnecessary tmpctx.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-01 03:12:43 +00:00
Christian Decker 3b9b7dc9dc wallet: Add a simple txo rescan command to sync with bitcoind UTXO
So many channels stuck in channeld_awaiting_lockin, and I don't like
suggesting manually editing the DB, so this adds a very simple way to
sync with bitcoind's UTXO view. `dev` since it is dangerous, then
again if bitcoind says those funds aren't available there's little we
can do anyway.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-02-01 03:12:43 +00:00
Christian Decker 11404f808e bitcoind: Disentangle gettxout from the scid verification
We may need to lookup UTXO entries for other reasons, so here we
disentangle it and make it into its own method.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-02-01 03:12:43 +00:00
ZmnSCPxj 87726d5b89 test_lightningd: Add test for reporting routing failures 2018-02-01 00:46:06 +00:00
ZmnSCPxj a043d1063a pay: Also report local channel failures to gossipd. 2018-02-01 00:46:06 +00:00
ZmnSCPxj 131283af6e test_lightningd: Move 0-payment test to its own test. 2018-02-01 00:46:06 +00:00
ZmnSCPxj 579011e980 pay: Report routing failures to gossip. 2018-02-01 00:46:06 +00:00
ZmnSCPxj c46727604e peer_htlcs: Prevent htlc_out from being handled multiple times in case of immediate channeld error. 2018-02-01 00:46:06 +00:00
ZmnSCPxj bd5dd46c4f peer_htlcs: Add missing assignment to hout->failcode. 2018-02-01 00:46:06 +00:00
ZmnSCPxj b2d8efcf25 pay: Move setting failed status on payment to after we get payment details. 2018-02-01 00:46:06 +00:00
ZmnSCPxj 67e2275383 gossipd: Add handling of channel_update to routing failures. 2018-02-01 00:46:06 +00:00
ZmnSCPxj 299b280f78 pay: Save nodes and channels used on route to payment. 2018-02-01 00:46:06 +00:00
ZmnSCPxj b255d82ae2 gossipd: Implement `gossip_routing_failure` for master to report routing failures. 2018-02-01 00:46:06 +00:00
Christian Decker 7a651c62fa gossip: Pull up the check for new channels before checking the txout
We drop all but the first announcement, so any work that is done for a
channel that we already know is wasted. Pulling this up duplicates
some of the work but allows us to skip the costly txout check.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-02-01 00:12:43 +00:00
Christian Decker d9d618aff9 jsonrpc: Fix wrong argument order in failed connection attempt
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-02-01 00:12:43 +00:00
Christian Decker fa1806da61 gossip: Deduplicate short_channel_id checks
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-02-01 00:12:43 +00:00
Christian Decker e2f5e4bb3c moveonly: Move find_pending_cannouncement up 2018-02-01 00:12:43 +00:00
ZmnSCPxj 8248dccaee channeld: Properly pad and HMAC onion replies that our masterd generated. 2018-01-31 21:17:56 +01:00
gdassori 7101db060b add mutually exclusive bolt11 & payment_hash to listpayments method 2018-01-31 12:38:18 +01:00
gdassori 72dd1461a0 async param is unwanted here 2018-01-31 12:38:18 +01:00
gdassori b9b0b7ebe0 fix LightningRpc signatures according to tests 2018-01-31 12:38:18 +01:00
gdassori bdcf38442b add port argument in connect, add getpeer method for test convenience 2018-01-31 12:38:18 +01:00
gdassori 67dbe71dfa update pylightning readme installation informations 2018-01-31 12:38:18 +01:00
gdassori 825ccb33a6 version bump 2018-01-31 12:38:18 +01:00
gdassori 51a491ef74 same methods of lightning-cli in pylightning 2018-01-31 12:38:18 +01:00
Rusty Russell 9825dddd18 test_lightning: test that we unwatch txs.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-31 11:37:22 +01:00
Rusty Russell c6ce352404 lightningd: actually unwatch txs when onchaind says we should.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-31 11:37:22 +01:00
Rusty Russell 6d0fd84c63 walletrpc: don't assert() when we pay ourselves.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-31 11:37:22 +01:00
Rusty Russell 0d3eaef945 tests: add argument to is_in_log so we can check only recent log entries.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-31 11:37:22 +01:00
Rusty Russell 2fbe3161a0 onchaind: remove unnecessary num_outputs arg from onchain_unwatch_tx
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-31 11:37:22 +01:00
Rusty Russell 64bdee6b6e bitcoind: add helper for arg manip, make array a const char *.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-31 04:15:55 +00:00