Commit Graph

3547 Commits

Author SHA1 Message Date
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
practicalswift e1f7428864 Remove unused parameter allow_mistakes in init_feerange(..., bool allow_mistakes) 2018-02-22 10:46:30 +01:00
practicalswift e28b646f4b Remove unused parameter their_offer in tell_master_their_offer(u64 their_offer, ...) 2018-02-22 10:46:30 +01:00
practicalswift 7f8ae7e0bf Remove unused parameter master in load_hsm(struct daemon_conn *master) 2018-02-22 10:46:30 +01:00
practicalswift f5742b0928 Remove unused parameter master in create_new_hsm(struct daemon_conn *master) 2018-02-22 10:46:30 +01:00
practicalswift 7be95cee94 Remove unused parameter ctx in wallet_peer_load(const tal_t *ctx, ...) 2018-02-22 10:46:30 +01:00
practicalswift 1f46262278 Remove unused parameter testname in create_test_db(const char *testname) 2018-02-22 10:46:30 +01:00
practicalswift 7dad639c49 Remove unused parameter msg in handle_funding_announce_depth(..., const u8 *msg) 2018-02-22 10:46:30 +01:00
practicalswift f15868a94d Remove unused function json_dev_broadcast(...) 2018-02-22 09:45:22 +00:00
Rusty Russell 3e7d98a52d status: don't log gossip messages in channeld.
Looking at an example log from #968, 288612 of 289244 lines were simply
channeld logging incoming and outgoing gossip.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-22 08:22:44 +00:00
Rusty Russell b536e97df2 dev_ping: don't crash with silly values.
It's a dev command, but still.

Fixes: #985
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-22 01:10:09 +00:00
practicalswift 91a9c2923f Mark intentionally unused parameters as such (with "UNUSED") 2018-02-22 01:09:12 +00:00
practicalswift 3dbace3421 Remove redundant casts to same type 2018-02-21 13:07:40 +01:00
Rusty Russell 369d3ab46e fixup! Close memory leak, make error exposure DEVELOPER=1 only. 2018-02-21 12:59:26 +01:00
Rusty Russell 9842e32e06 lightningd: expose internal error information.
In #1018 we got no information, except "Internal error".  At least
if we tell the other side what went wrong, we're more likely to get
an answer.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-21 12:59:26 +01:00
Rusty Russell 1192f16733 lightningd: fix crash when htlc failed and source is onchain.
If the source channel is onchain, we try to send a message to onchaind
which (1) doesn't care, (2) doesn't take a channel_fail_htlc msg, and
(3) causes us to crash in subd.c:

	assert(!strstarts(sd->msgname(fromwire_peektype(msg_out)), "INVALID"));

Fixes: #821
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-20 22:58:48 +01:00
Rusty Russell e92b710406 tools/generate-wire.py: remove length argument from fromwire_ routines.
We always hand in "NULL" (which means use tal_len on the msg), except
for two places which do that manually for no good reason.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-20 22:36:21 +01:00
Rusty Russell 719290a4c4 txwatch: remove unused callback arg, hide struct definitions.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-20 22:36:21 +01:00
Rusty Russell ae8fb96d06 lightningd/channel_control: routines to control channeld (move from peer_control.c)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-20 22:36:21 +01:00
Rusty Russell 36652a3df3 lightningd/peer_control: reorder, move more functions out.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-20 22:36:21 +01:00
Rusty Russell 372040bbd5 lightningd/onchain_control: routines to control onchaind (move from peer_control.c)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-20 22:36:21 +01:00
Rusty Russell 9176ee628c lightningd/closing_control: routines to control closingd (move from peer_control.c)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-20 22:36:21 +01:00
Rusty Russell a83ff83328 lightningd/connect_control: routines to control connecting (move from peer_control.c)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-20 22:36:21 +01:00
Rusty Russell 4cf274b1c0 lightningd/opening_control: routines to control openingd (move from peer_control.c)
We also fold opening_got_hsm_funding_sig() into the caller; it was
previously a callback before we decided to always use the HSM
synchronously.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-20 22:36:21 +01:00
practicalswift d2265cd3d2 Make sure msatoshi and sender are not uninitialized when calling channel_add_htlc(...) 2018-02-20 22:13:59 +01:00
Rusty Russell eca55cee3c subd: handle stdin being closed (eg. --daemon).
We need to do a more complex dance if stdin was important.

Fixes: #1016
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-20 21:42:53 +01:00
practicalswift 6bacab5e87 Fix typos 2018-02-20 13:05:51 +01:00
Rusty Russell 4aeebe88f2 log: fix ltmp crash.
When we clear and recreate ltmp, we attach it to whatever logbook it's on.
This, of course, is fraught, since it may be freed.

We could make it NULL-parented, but that makes YA special-case to free
when we exit (we try to keep valgrind happy by freeing everything).  So
since the first log_book is the permanent one attached to lightningd,
just keep that parent when we re-build it after use.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-20 12:58:13 +01:00
Igor Cota d4d1c4acb0 Add PIE option to Makefile to build position independent executables
As of version 5.0 Android requires all dynamically linked executables to support PIE. This allows programs to be loaded at a different addresses, making it harder for attackers to target.
Enable with PIE=1
2018-02-20 03:55:53 +00:00
libbitc c360cb7b1f Add option to specify pid file
Closes #969
2018-02-20 03:24:23 +00:00
Igor Cota bd95aba7a5 Pass the compiler variable to the configurator executable when building ccan/config.h
When cross compiling it's important that the resulting config.h reflects the platform we are building for and not the one we are building on.
Otherwise we end up with a config.h that defines headers that are not there on the target platform, wrong endnianness and so on.
The -static flag is there to be able to easily run the configurator test executables on the build machine with qemu-*.
E.g. Without the -static flag the resulting dynamically linked ARM executables complain about the lack of linker (/lib/ld-linux-armhf.so or /system/bin/linker for Android), since these files are not usually available on the build machine building statically avoids this problem and results in a proper config.h for cross compiling.
2018-02-20 03:18:11 +00:00
gabridome 3a5aa75fb6 A more detailed description of the "amount" field
The more frequent question I ask to myself when initiating channels regards the amount field.

In this document we have three different denominations and the modification proposed aims to address the possible doubts or errors.
The names <amount_in_bitcoins>, <amount_in_satoshis> or <amount_in_millisatoshis> (this last is omitted because the denomination is in the description) are not so elegant but they could serve the purpose.
2018-02-20 03:06:53 +00:00