Commit Graph

3378 Commits

Author SHA1 Message Date
practicalswift bb12c234f2 Fix recently introduced PEP-8 violations 2018-02-24 11:44:32 +01:00
Christian Decker 330682abfe pytest: Remove any existing lightning-dirs before running
This was causing some issue when automatically rerunning tests on
travis.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-02-24 10:40:03 +01:00
Christian Decker da062df594 make: If running on travis allow 3 reruns of failed tests
This may mask a few flaky tests, but cuts down on the manual reruns.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-02-24 10:40:03 +01:00
Christian Decker 68a9951fb9 contrib: Add pytest-reruns into the builder image
Should allow us to reduce the number of manual reruns, but may hide
some flaky tests.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-02-24 10:40:03 +01:00
Christian Decker ac21ac3653 contrib: Add flake8 to builder container images
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-02-24 10:40:03 +01:00
Rusty Russell 737a7148b5 test_lightningd.py: make sure we recover from transient bitcoin failures.
We can do similar tricks to test other things, even to run without a
real bitcoind for faster testing, but for now we simply exit if a magic
file says so.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-24 10:37:28 +01:00
Rusty Russell 50171d3e1a lightningd: add --bitcoin-cli arg for testing.
And remove unused bitcoin_datadir and BITCOIN_CLI.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-24 10:37:28 +01:00
Rusty Russell f0a12c5c23 bitcoind: retry after one second if a call fails.
There are two recurring calls: the estimatefee call and the
getblockcount call.  Currently we simply discard them on error, the
timer isn't rearmed.

This should fix a number of cases where bitcoind has an intermittant
failure and lightningd simply stops collecting blocks.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-24 10:37:28 +01:00
Rusty Russell 0204c44243 bitcoind: allow processing callbacks to indicate that a failure is spurious.
In particular, process_getblockhash() exits with status 8 when the block
number is out of range, which is expected.  Any other exit status should
be treated as a spurious error.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-24 10:37:28 +01:00
Christian Decker 7c8883ae7d wallet: Fix an off by one error in dev-listaddrs
Reported-By: @Xian001
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-02-23 21:53:40 +00:00
arowser 73fab9e345 move library path to LDLIBS 2018-02-23 21:49:00 +00:00
ZmnSCPxj, ZmnSCPxj jxPCSmnZ ae6b901e78 README: add link to our shiny new mailinglist 2018-02-23 19:09:48 +01:00
Rusty Russell 5de6a3cf12 fixup! onchain message should be ONCHAIN: not FUNDING_SPEND_SEEN 2018-02-23 18:02:00 +01:00
Rusty Russell 309dc96f97 fixup! More test fixups from last patch. 2018-02-23 18:02:00 +01:00
Rusty Russell cccdb53bec channel_states: fold all the ONCHAIND states into one.
The billboard is now far more useful to tell what's going on, and this
gets us closer to a state == owner mapping.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-23 18:02:00 +01:00
Rusty Russell 866ba00445 test_lightning.py: test in billboard in various closing cases.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-23 18:02:00 +01:00
Rusty Russell 8946ecc7b5 onchaind: keep billboard uptodate.
This uses the permanent slot to indicate what's happening overall, and
the transient slot is updates with what we expect to happen next.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-23 18:02:00 +01:00
Rusty Russell 7e0f2c4d26 onchaind: two small changes.
I generally tried not to alter internal logic to add billboards (to avoid
breakage), but these two make things neater.

1. Free ->proposal if it's not longer valid.  That way we don't get confused
   by reporting old proposals.
2. Change all_irrevocably_resolved() to num_not_irrevocably_resolved() so
   we can report that number to the billboard.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-23 18:02:00 +01:00
Rusty Russell c57aa628e3 closingd: update billboard as negotiation proceeds.
We use the permanent slot to indicate our overall negotiation range,
and the transient slot to say what we're waiting for.

On success, we update the permanent slot to indicate the final value.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-23 18:02:00 +01:00
Rusty Russell 8640a5c329 channeld: keep billboard uptodate.
For the moment, this just tracks the lockin, announce and shutdown
statuses.

We currently have trouble telling when we're stuck in
CHANNELD_AWAITING_LOCKIN who has sent the transaction.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-23 18:02:00 +01:00
Rusty Russell 10361d5308 openind: update billboard.
This mainly lets us know if we're blocked on reading from peer.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-23 18:02:00 +01:00
Rusty Russell 9cffa03647 peer_failed: set permanent slot when we fail the peer.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-23 18:02:00 +01:00
Rusty Russell 8aa7a48138 listpeers: display billboard as 'status' array.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-23 18:02:00 +01:00
Rusty Russell d4a172e221 common: peer_billboard() helper for updating the billboard.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-23 18:02:00 +01:00
Rusty Russell cca0a5412e subd: clear transient billboard on start and shutdown.
Use NULL on the callback to mean "clear the slot", and call it.

We have do this in two places: the old daemon might die, or the new
daemon might start first.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-23 18:02:00 +01:00
Rusty Russell 26b004e5af subd: handle status_peer_billboard messages from subdaemons.
We use a callback which updates the appropriate slot.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-23 18:02:00 +01:00
Rusty Russell db4de95033 lightningd: single transient billboard for opening peers.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-23 18:02:00 +01:00
Rusty Russell 86a04c59d4 lightningd: maintain a status billboard for each channel.
Each state (effectively, each daemon) has two slots: a permanent slot
if something permanent happens (usually, a failure), and a transient
slot which summarizes what's happening right now.

Uncommitted channels only have a transient slot, by their very nature.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-23 18:02:00 +01:00
Christian Decker d499c34db2 fixup! options: Add `--offline` to disable listening and auto-reconnection 2018-02-23 06:30:15 +00:00
Christian Decker 6f6176a91e options: Add `--offline` to disable listening and auto-reconnection 2018-02-23 06:30:15 +00:00
practicalswift 0a20bd44f0 Fix flake8 warnings: W191 indentation contains tabs + E101 indentation contains mixed spaces and tabs 2018-02-22 22:21:31 +01:00
practicalswift e18948a6a9 Remove unused variables. Fix flake8 warnings. 2018-02-22 22:21:31 +01:00
Rusty Russell b8c636514b pong: embed version string into ping replies if DEVELOPER=1.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-22 12:24:26 +01:00
Rusty Russell 85f1a9b825 lightningd: append (as much as we can) version into default name if DEVELOPER=1
This helps for bug reporting, where we may need to diagnose the other
end.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-22 12:24:26 +01:00
Rusty Russell 655ae90e5e wallet: remove obsolete peers.
Fixes: #1029
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-22 12:06:39 +01:00
practicalswift ae7d857c44 Make Python code conform to the Python PEP 8 style guide 2018-02-22 10:47:19 +01:00
practicalswift 0ac5e93065 Remove unused parameters a_sent and b_sent in draw_restart(.., struct sent **a_sent, struct sent **b_sent, ...) 2018-02-22 10:46:30 +01:00
practicalswift 2e7791f798 Remove unused parameter ci in db_send_local_revoke(..., const struct commit_info *ci) 2018-02-22 10:46:30 +01:00
practicalswift 31fed45d10 Remove unused parameters peer and sig in db_send_remote_commit(struct peer *peer, ..., struct signature sig) 2018-02-22 10:46:30 +01:00
practicalswift 7a5ce1db7d Remove unused parameter shaseed in handle_their_unilateral(..., const struct sha256 *shaseed, ...) 2018-02-22 10:46:30 +01:00
practicalswift 6682248b91 Remove unused parameter tx in handle_mutual_close(const struct bitcoin_tx *tx, ...) 2018-02-22 10:46:30 +01:00
practicalswift 1b51b5ae0f Remove unused parameter topo in txw_fire(struct chain_topology *topo, ...) 2018-02-22 10:46:30 +01:00
practicalswift 0046ace318 Remove unused parameter topo in txowatch_fire(struct chain_topology *topo, ...) 2018-02-22 10:46:30 +01:00
practicalswift 74841ef567 Remove unused parameter payment_hash in forward_htlc(..., const struct sha256 *payment_hash, ...) 2018-02-22 10:46:30 +01:00
practicalswift d873bf60bf Remove unused parameter fieldname in json_add_log(..., const char *fieldname, ...) 2018-02-22 10:46:30 +01:00
practicalswift 2ab274595e Remove unused parameter ptr in corrupt(const void *ptr, ...) 2018-02-22 10:46:30 +01:00
practicalswift f24eae60b7 Remove unused parameter why in delete_channel(..., const char *why) 2018-02-22 10:46:30 +01:00
practicalswift 99ce580e20 Remove unused parameter rstate in routing_failure_on_nc(struct routing_state *rstate, ...) 2018-02-22 10:46:30 +01:00
practicalswift 0013caedfe Remove unused parameter rstate in get_out_node_connection_of(struct routing_state *rstate, ...) 2018-02-22 10:46:30 +01:00
practicalswift a3cd9495ef Remove unused parameter rstate in delete_connection(struct routing_state *rstate, ...) 2018-02-22 10:46:30 +01:00