Christian Decker
63f22d70b5
gossip: Store channel deletions so we don't re-add them on restart
...
If we only remember the actions that added channels then we'd restore them when
re-reading the gossip_store, so put a tombstone in there to remember to delete
it. These will be cleared upon re-writing the store since the announcements wont
be written anymore.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-30 16:35:00 +02:00
Christian Decker
633f893ec4
gossip: Add function to notify gossipd about an outpoint spend
...
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-30 16:35:00 +02:00
Christian Decker
5571f2143e
gossip: Added message to notify gossipd of outpoint spends
...
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-30 16:35:00 +02:00
Rusty Russell
4139f06780
json_getnodes: escape the alias when we print it out.
...
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-26 00:20:53 +00:00
Christian Decker
0a5ea76d77
gossip: Add message types to store gossip msgs and associate data
...
Since we may want to extend the on-disk format by adding custom information we
may as well just go the extra mile and reuse the serialization primitives we
already have.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-25 23:56:59 +00:00
ZmnSCPxj
9efe123a0d
lightningd/json: Move json helpers specific for lightningd to new module.
2018-03-19 00:27:55 +00:00
practicalswift
b206aed371
Remove redundant cast to same type
2018-03-16 01:17:40 +00:00
Rusty Russell
0a6e3d1e13
utils: remove tal_tmpctx altogether, use global.
...
In particular, we now only free tmpctx at the end of main().
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-16 00:16:10 +00:00
Rusty Russell
46cc7c281e
features: more general accessor functions.
...
As we add more features, the current code is insufficient.
1. Keep an array of single feature bits, for easy switching on and off.
2. Create feature_offered() which checks for both compulsory and optional
variants.
3. Invert requires_unsupported_features() and unsupported_features()
which tend to be double-negative, all_supported_features() and
features_supported().
4. Move single feature definition from wire/peer_wire.h to common/features.h.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-14 02:19:37 +00:00
Christian Decker
74a444eb7a
jsonrpc: Return the channel capacity for listchannels
...
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-12 22:34:51 +00:00
Christian Decker
5690783148
gossip: Pass output value to gossipd
...
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-12 22:34:51 +00:00
Christian Decker
a8e553098a
gossip: Pass output value to gossipd
...
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-12 22:34:51 +00:00
Christian Decker
cb4ba9bf4f
gossip: Use the utxoset to shortcircuit the txout lookup
...
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-12 22:34:51 +00:00
Isidoro Ghezzi
f24a7b9356
help: listnodes and listchannels,have optional arg
2018-03-11 14:27:09 +01:00
John Barboza
0a1351fd51
gossipd: command to disconnect from a gossiping peer
...
lightning-cli disconnect <peer id>
2018-03-07 16:14:01 +01:00
Rusty Russell
042d5d13f5
short_channel_id: don't use bitfields.
...
I leave all the now-unnecessary accessors in place to avoid churn, but
the use of bitfields has been more pain than help.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-01 23:33:56 +01:00
Rusty Russell
cf3f19524e
gossip: formalize passing of siphash_seed.
...
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-26 06:35:02 +00:00
ZmnSCPxj
d23650d2ed
Explain fuzz initial values.
2018-02-26 02:36:27 +00:00
ZmnSCPxj
2db6ff9186
gossip_control: Change defult fuzz of getroute to 75%.
2018-02-26 02:36:27 +00:00
ZmnSCPxj
6767434ea9
routing: Use siphash24 for route randomization
...
Primary idea by @rustyrussell
2018-02-26 02:36:27 +00:00
ZmnSCPxj
216c52940d
gossipd: Add fuzz and seed to getroute request.
2018-02-26 02:36:27 +00:00
ZmnSCPxj
2b782ee436
gossip_control: Add fuzz and seed parameters.
...
In preparation for improved route randomization.
2018-02-26 02:36:27 +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
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
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
Christian Decker
cb97dfec4e
gossip: Fix up some comments on PR #955
...
Just some minor things that were suggested during review.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-02-11 11:40:59 +01:00
root
73022d91c6
Fix indentation
2018-02-10 21:30:46 +01:00
root
8b0ed27c43
Add optional from id parameter to getroute call.
2018-02-10 21:30:46 +01:00
Rusty Russell
526d3a232e
tools/generate_wire.py: generate varlen arrays properly.
...
These are now logically arrays of pointers. This is much more natural,
and gets rid of the horrible utxo array converters.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-08 19:07:12 +01:00
ZmnSCPxj
0d0ef2c733
gossipd: Implement gossip_mark_channel_unroutable.
...
Temporarily marks a channel as unroutable.
2018-02-08 00:51:30 +00:00
Rusty Russell
91a22dc496
jsonprc: make json_get_params() fail the command, for better error reporting.
...
We move it into jsonrpc where it belongs, and make it fail the command.
This means it can tell us exactly what was wrong.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-02 00:05:00 +01:00
ZmnSCPxj
b255d82ae2
gossipd: Implement gossip_routing_failure
for master to report routing failures.
2018-02-01 00:46:06 +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
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
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
practicalswift
5631054152
Start all command descriptions with a verb ("Show", "Set", etc.). Remove unused help texts.
2018-01-23 13:32:44 +01:00
Rusty Russell
06c4f6ddca
JSONRPC: add optional short_channel_id argument to listchannels
...
In order to just list one (though it may return two entries, one for each
channel direction!).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-19 22:23:45 +00:00
Rusty Russell
7fdb30cbda
JSONRPC: rename getchannels to listchannels
...
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-19 22:23:45 +00:00
Rusty Russell
e1e7f289fb
JSONRPC listnodes: return timestamp, alias and color.
...
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-19 22:23:45 +00:00
Rusty Russell
ced572b973
JSONRPC: getnodes: rename to listnodes.
...
Like listinvoice, and add optional 'id' parameter to ask about a
specific node.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-19 22:23:45 +00:00
Rusty Russell
4b663e596a
lightningd: don't crash when txout lookup fails.
...
Gossipd already correctly handles the "empty output means lookup failed" case.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-15 19:29:01 +00:00
Christian Decker
7fc8e3a4e2
gossip: Pass --channel-update-interval to gossipd
...
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-01-14 23:40:04 +00:00
ZmnSCPxj
83e76e3ac3
features: Move feature-handling code to a common/features.c source.
2018-01-13 11:29:42 +01:00
Rusty Russell
d4c8210a9e
gossipd: don't hang if we try to connect to already-connected peer.
...
Closes : #287
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-11 23:47:47 +01:00
Rusty Russell
e22dd5ad71
lightningd: implement gossip_get_txout/gossip_get_txout_reply.
...
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-11 23:13:23 +01:00
Rusty Russell
7e0bc88e2a
gossip: fix default broadcast interval, move option.
...
This now makes a few more gossip tests time out without --dev-broadcast-interval
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-11 21:39:13 +01:00
Rusty Russell
a8de8a3140
json_getchannels: add public flag.
...
Fixes : #509
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-08 18:09:31 +01:00
Rusty Russell
7975a1cbfc
json_getchannels: short_id -> short_channel_id, use standard format.
...
We include flags separately, so name this field as per spec.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-08 18:09:31 +01:00
Rusty Russell
8c665835fa
jsonrpc: make explicit call to indicate cmd is still pending.
...
jsonrpc handlers usually directly call command_success or
command_fail; not doing that implies they're waiting for something
async.
Put an explicit call (currently a noop) there, and add debugging
checks to make sure it's used.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-12-20 12:43:10 +01:00