Commit Graph

3007 Commits

Author SHA1 Message Date
Rusty Russell fc43c4824a openingd: handle unexpected messages better.
In particular, this one didn't handle them trying to open a different
channel at the same time.  Again, deliberately very similar, but
unfortunately different enough that sharing is awkward.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-30 19:47:27 +00:00
Rusty Russell 7a40e0262f closingd: handle unexpected messages better.
In particular, handle pings.  The rest is modelled on the channeld one,
but annoyingly different enough that it's hard to share code without
significant work.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-30 19:47:27 +00:00
Rusty Russell dd044f826b channeld: handle unexpected messages better.
In particular, decode error messages correctly and do the right thing with
messages about other channels.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-30 19:47:27 +00:00
Rusty Russell 1a297a7010 bitcoind: mark request no longer running, even if it fails.
We added code to allow a few spurious failures, but it didn't unmark
the request running.

IRC user 'mlz' (@molxyz) provided logs from his stuck-at-old-block lightningd:

lightningd(31981): Adding block 1261159: 00000000da3890ccd0f313a74fccfd4789654b496836da5c28a8d2ad28852264

lightningd(31981): Adding block 1261160: 00000000f70938a33aecbdd7b047cb5cf5b095ea4770c1335acf1859bad1e767

lightningd(31981): bitcoin-cli -testnet estimatesmartfee 2 CONSERVATIVE exited with status 1

Fixes: #749
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-30 15:19:45 +01:00
windsok fc73b1eb72 remove stray semicolons in python tests 2018-01-30 08:11:51 +00:00
windsok de5d78a359 update references to sat/kb to sat/kw 2018-01-30 08:11:51 +00:00
Christian Decker 0223d836ac contrib: Updated bitcoind in CI builder image to 0.15.1
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-01-29 20:35:59 +00:00
Christian Decker 0d9a749282 github: Added issue template 2018-01-29 13:28:48 +01:00
Rusty Russell 7db88f0b8a external: make submodule hacks more general, and common.
We can't rely on the existence or not of a header, as Carl's
delete-and-make-submodule change showed.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-29 06:21:07 +00:00
Carl Dong e624046c74 external/Makefile: Initialize/update libwally-core submodule. 2018-01-29 06:21:07 +00:00
Carl Dong a6e2e46b54 Submodulize and update libwally-core for LTO removal. 2018-01-29 06:21:07 +00:00
Rusty Russell 635b7d5799 Revert changes to external files.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-29 16:50:17 +10:30
Rusty Russell 6daa770b0e Minor whitespace/comment spelling fixes.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-29 06:01:56 +00:00
Christian Decker acc6afc8de gossip: Directly return an error if we don't know a node's address
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-01-29 06:01:56 +00:00
Christian Decker 61e982c6b7 gossip: Implement connection failed handler in lightningd
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-01-29 06:01:56 +00:00
Christian Decker 932dbd8c2c gossip: Give up connecting after 10 attempts
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-01-29 06:01:56 +00:00
Christian Decker f5147f27c9 gossip: Added message for unsuccessful connection attempts
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-01-29 06:01:56 +00:00
Ronald van der Meer 6a9f40f7cc Different states explained 2018-01-29 04:47:59 +00:00
rvandermeer 4c0f7dbd04 Spelling corrections (#824)
* Small spelling fixes, and clarity for 'iff'

[ Squashed commit --RR ]
2018-01-29 04:46:54 +00:00
ZmnSCPxj 8f5584d7d6 peer_control: Correct roundoff of remote-side msatoshi.
Fixes: #818
2018-01-29 04:44:18 +00:00
practicalswift 7e8f1945f2 Adjust tests to new log text 2018-01-29 03:22:27 +00:00
practicalswift 689db5b7c1 Onboarding: Make log output texts friendlier to new users 2018-01-29 03:22:27 +00:00
Christian Decker 92ce3d5e8d opts: Declare --port to be an early arg
There is an interaction between --ipaddr and --port, namely that the
default port is used when parsing --ipaddr if --port comes after the
--ipaddr, and --port is used if it comes before it. Adding a port to
--ipaddr still trumps everything else, but this way we correctly set
port in the address.

Reported-by: Wladimir J. van der Laan @laanwj
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-01-29 03:21:25 +00:00
Ephraim Raj a095a59083 Allow pong when in CHANNELD_AWAITING_LOCKIN
Right now it allows ping but not pong. 
If A sends a ping expecting a pong to B during CHANNELD_AWAITING_LOCKIN,
It would result in 
`STATUS_FAIL_PEER_BAD: WIRE_PONG (19) before funding locked`    
resulting in a unilateral channel close by A.
2018-01-28 22:56:00 +01:00
Luca Vaccaro af26c91a2c Add litecoin testnet support 2018-01-28 13:56:28 +01:00
practicalswift 9f47c0431a Fix typos 2018-01-28 13:53:39 +01:00
luca vaccaro d36fa33c9b Explain table vars (#792)
* Database Table vars

Explain Database Table vars and bip32_max_index variable.
2018-01-28 01:41:31 +01:00
ZmnSCPxj d03ca59f80 jsonrpc: Report standard JSON-RPC 2.0 error codes. 2018-01-27 14:32:06 +01:00
ZmnSCPxj e1d17e92e0 jsonrpc: Implement command_fail_detailed. 2018-01-27 14:32:06 +01:00
ZmnSCPxj 551dfedc4a jsonrpc: Internal: Support changing the error code internally. 2018-01-27 14:32:06 +01:00
ZmnSCPxj b2133e969f jsonrpc: Trivial compliance with JSON-RPC Error Object. 2018-01-27 14:32:06 +01:00
ZmnSCPxj 8c527f3931 common/json: Implement json_add_snum for signed numbers. 2018-01-27 14:32:06 +01:00
Christian Decker 1da27c51c2 gossip: Remove annoying nonlocal_gossip_broadcast_done status
Reported-by: @RvMP
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-01-27 02:27:35 +00:00
Christian Decker a7a6b4646a json-rpc: Remove alarming debug statement
People keep on stumbling over this, since it's rather alarming.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-01-27 02:27:35 +00:00
Christian Decker 3d2ef44064 gossipd: Do not report bind failures for IPv4 2018-01-27 02:27:35 +00:00
Christian Decker 8bf9f28a79 doc: Specify that pruned nodes do not work currently 2018-01-27 02:27:35 +00:00
Christian Decker 45c935ddba pytest: Have the db_query helper work on a copy of the DB
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-01-27 02:27:35 +00:00
Rusty Russell 24ba5d6250 channeld: don't spam with all our attempts to commit.
Reported-by: @jb55
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-26 17:53:50 +01:00
Ronald van der Meer 8e087c1d71 clarified lightning-cli help dev-setfees description 2018-01-26 03:00:29 +00:00
Ronald van der Meer fa992ecaab clarified --lightning-dir syntax on help 2018-01-26 03:00:29 +00:00
William Casarin 5b4a62d822 doc: some sqlite db info for HACKING
Signed-off-by: William Casarin <jb55@jb55.com>
2018-01-26 01:20:07 +00:00
Christian Decker 6cfc0a6275 fixup! masterd: Disable a channel when channeld fails 2018-01-26 01:09:44 +00:00
Christian Decker 2e5047f74b pytest: Fix test_pay_disconnect
We are now too quick in disabling the channel for us to attempt a
payment. We need to separate into getroute and sendpay to trigger this
now.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-01-26 01:09:44 +00:00
Christian Decker dafd000c2a pytest: Check that we disable on closing and permfail.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-01-26 01:09:44 +00:00
Christian Decker e463386d75 masterd: Disable a channel when channeld fails
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-01-26 01:09:44 +00:00
Christian Decker 007c349dec gossip: Implement handler for enabling and disabling channels
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-01-26 01:09:44 +00:00
Christian Decker c6ae4b521f gossip: Add message to enable and disable a channel
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-01-26 01:09:44 +00:00
Christian Decker d14969ce77 masterd: Peer has to know which direction an eventual channel is
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-01-26 01:09:44 +00:00
Christian Decker 4f4b0e9bba channeld: Tell gossipd when we get a shutdown message from a peer
Disabling the channel and enqueing the update for broadcast so we
don't get forwarding requests from remote peers, and we don't try to
ourselves.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-01-26 01:09:44 +00:00
Christian Decker 6320142c34 channeld: Send disabling channel_update on shutdown
Sends a disable channel_update before issuing the shutdown message,
gossipd will also take care to update others and not use for future
routes.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-01-26 01:09:44 +00:00