Commit Graph

2812 Commits

Author SHA1 Message Date
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
William Casarin 8aee38162c doc: Nix{,OS} build instructions
Signed-off-by: William Casarin <jb55@jb55.com>
2018-01-26 01:02:51 +00:00
practicalswift 17aaa1d235 Fix lightning typos 2018-01-26 01:02:15 +00:00
practicalswift 3e40a48332 Add lightning spell check 2018-01-26 01:02:15 +00:00
practicalswift 2c17546cbd Onboarding: Make "lightning-cli" (without arguments) output the equivalent of "lightning-cli --help; lightning-cli help"
New users invoking lightning-cli are likely interested in what RPC
commands they can invoke via the command.
2018-01-26 00:35:13 +00:00
Rusty Russell bab3b1a16b wallet: get first blocknum from any channels.
The previous tests didn't make sense anyway, but I think they were trying
to exclude onchain channels.

We delete completely forgotten channels anyway now, so we don't need
such testing.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-25 12:52:06 +01:00
Rusty Russell 661950e402 wallet: fix logic for finding first block.
Over 20 years a professional C programmer, still can't count from zero!

Fixes: #709
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-25 12:52:06 +01:00
Rusty Russell e66bd25b5c test_lightningd.py: test lockin while we're not running.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-25 12:52:06 +01:00
Rusty Russell 9f9c34002e chain_topology: log block height, not just hash.
Saves me a lookup.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-25 12:52:06 +01:00
Rusty Russell e9328217ff peer_control: better logging when we don't tell peer about locked funding.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-25 12:52:06 +01:00
Rusty Russell c42fa4404a connect: succeed if we connect to peer and it *doesn't* go back to gossipd.
The JSON connect command wouldn't terminate if peer reconnected
in a state CHANNELD_AWAITING_LOCKIN or above.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-25 12:52:06 +01:00
practicalswift b91556283b Onboarding: Adjust log level for common non-fatal peer state condition from info to debug 2018-01-25 00:28:47 +00:00
practicalswift 3a8220d630 Warn instead of crash when extract_feerate(...) fails
Fixes: #722
2018-01-25 00:16:14 +00:00
practicalswift 0557467dfa Adjust log level for feerate warnings
This condition seems to be triggered quite common on testnet, so no
need for warning floods unless we're running in debug mode :-)
2018-01-25 00:15:47 +00:00
Christian Decker 7b0d806d71 pytest: Check that we forget irrevocably settled channels
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-01-25 00:14:23 +00:00
Christian Decker 9588c961bb wallet: Forget channels that are irrevocably settled on-chain
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-01-25 00:14:23 +00:00
Rusty Russell f03dbde354 test_lightningd.py: Test 0-msatoshi pay
Based-on-patch-by: ZmnSCPxj <ZmnSCPxj@protonmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-24 19:34:46 +01:00
Rusty Russell 45665a994b htlc_end: allow htlc_out to have 0 msatoshi.
Such an htlc is invalid, and will be failed cleanly by our channeld
(which also checks that it meets the minimum amount), but it's
not the master's job to check it, and in fact, it asserts if we were
to try to pay or forward such a thing.

Fixes: #686
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-24 19:34:46 +01:00
Rusty Russell 3ccf88d6c4 lightningd: check channeld isn't trying to add 0-satoshi incoming HTLCs.
The peer shouldn't try, and channeld won't try to add it if it does,
but we shouldn't trust it.  And it would make our htlc_in_check() code
assert.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-24 19:34:46 +01:00
William Casarin 3cb03ab784 bitcoin: add test programs to ALL_TEST_PROGRAMS
* Add BITCOIN_TEST_PROGRAMS to ALL_TEST_PROGRAMS
* Refactor bitcoin test make directives into its own Makefile under bitcoin/test

Signed-off-by: William Casarin <jb55@jb55.com>
2018-01-24 17:42:32 +01:00
alaniz 5421e9f6f2 pylightning: Add and move example to README 2018-01-24 17:30:32 +01:00
practicalswift 96d093fb30 Fix typos 2018-01-24 17:29:40 +01:00
Carl Dong feb734086b build: Update INSTALL.md to include FreeBSD. 2018-01-23 16:10:19 +01:00
Carl Dong f55adbdc9c build: Add necessary build/link flags for FreeBSD. 2018-01-23 16:10:19 +01:00
Carl Dong 8da65854f0 build: Add needed UNIX standard includes. 2018-01-23 16:10:19 +01:00
Carl Dong 75f4b56766 build: Correctly build and link ptr_valid. 2018-01-23 16:10:19 +01:00
Björge Dijkstra 2f4ba73c77 Allocate hex buffer on heap since it can be very large. 2018-01-23 13:33:29 +01:00
practicalswift 5631054152 Start all command descriptions with a verb ("Show", "Set", etc.). Remove unused help texts. 2018-01-23 13:32:44 +01:00
ZmnSCPxj 940819567d lightning-cli: Add support for null argument. 2018-01-23 12:21:56 +01:00
practicalswift 22087dad03 Adjust log level: Warn about ignored fee limits only in debug log 2018-01-22 19:23:23 +01:00
Rusty Russell 1bd40a8da6 lightning-cli: make valgrind happy by freeing opt table.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-22 18:58:23 +01:00
Rusty Russell aa34ad30d9 lighting-cli: do incremental parsing.
Far less hacky, and a little faster:

real	0m0.168s
user	0m0.135s
sys	0m0.033s

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-22 18:58:23 +01:00
Rusty Russell 2ff9e42b33 lightning-cli: fix amazingly slow getlogs speed.
real	0m0.380s
user	0m0.331s
sys	0m0.028s

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-22 18:58:23 +01:00
Rusty Russell 61cff03465 lightning-cli: test for amazingly slow getlogs speed.
real	3m51.167s
user	3m51.065s
sys	0m0.080s

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-22 18:58:23 +01:00
Rusty Russell c22d2c8dae Makefile: rebuild all objects if Makefile changes.
This doesn't cover external libs in general (which *could* be effected by
CFLAGS), but at least all our own objects are rebuilt.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-22 18:58:23 +01:00
alaniz 73c31757e1 Fixed and updated README RPC doc links 2018-01-21 23:59:13 +00:00
William Casarin f8e5de1974 listpeers: print channel configs
Signed-off-by: William Casarin <jb55@jb55.com>
2018-01-21 23:03:07 +01:00
frennkie 1616fcbffe change getchannels to listchannels 2018-01-21 14:25:38 +01:00
frennkie 0702ee6d81 Update to listpeers
See 5698a133c2
2018-01-21 14:25:38 +01:00
frennkie 16455e658d fix typo 2018-01-21 02:40:10 +01:00
Ephraim Raj 041b641161 Added that peer id should be given to dev-sign-last-tx 2018-01-20 17:57:04 +01:00
Thijs van den Anker 2b6356f87a Fix 'Receiving and receiving payments' in readme
Changed`Receiving and receiving payments` to `Sending and receiving payments` in the readme.
2018-01-20 17:00:38 +01:00
practicalswift 2f179fb6cb Don't greet new users with an error message
Before this patch:

```
$ lightningd/lightningd
lightningd(PID): Creating lightningd dir /root/.lightning (because chdir gave No such file or directory)
lightningd(PID): Creating database
```

After this patch:

```
$ lightningd/lightningd
lightningd(PID): Creating lightningd dir /root/.lightning
lightningd(PID): Creating database
```
2018-01-20 01:32:59 +01:00
Tomas Stary e2d66136d3 adding the bash completition script for the client 2018-01-19 22:28:14 +00:00
Christian Decker ee850f38d6 pytest: Fix test_fee_limits
This was flaky because we didn't wait for the fee update to complete
and were using the old, way too small, fees, which upset bitcoind.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-01-19 22:26:58 +00:00
Christian Decker 97447dd4c4 options: Dropping default base_fee for mainnet to 1 satoshi
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-01-19 22:25:16 +00:00