Rusty Russell
5551c161ca
gossipd: finish startup before master prints that it's ready.
We're about to remove automatic retrying of connect, and that uncovered
that we actually print out our "Server started" message before we create
the listening socket.
Move the init higher (outside the db transaction) and make it a
request/response, the loop until it's done.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
b0c2e3cd5c
gossipd: use a separate CSV file for the gossip_store types.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
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>
7 years ago
Christian Decker
633f893ec4
gossip: Add function to notify gossipd about an outpoint spend
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
5571f2143e
gossip: Added message to notify gossipd of outpoint spends
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Rusty Russell
4139f06780
json_getnodes: escape the alias when we print it out.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
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>
7 years ago
ZmnSCPxj
9efe123a0d
lightningd/json: Move json helpers specific for lightningd to new module.
7 years ago
practicalswift
b206aed371
Remove redundant cast to same type
7 years ago
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>
7 years ago
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>
7 years ago
Christian Decker
74a444eb7a
jsonrpc: Return the channel capacity for listchannels
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
5690783148
gossip: Pass output value to gossipd
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
a8e553098a
gossip: Pass output value to gossipd
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
cb4ba9bf4f
gossip: Use the utxoset to shortcircuit the txout lookup
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Isidoro Ghezzi
f24a7b9356
help: listnodes and listchannels,have optional arg
7 years ago
John Barboza
0a1351fd51
gossipd: command to disconnect from a gossiping peer
lightning-cli disconnect <peer id>
7 years ago
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>
7 years ago
Rusty Russell
cf3f19524e
gossip: formalize passing of siphash_seed.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
ZmnSCPxj
d23650d2ed
Explain fuzz initial values.
7 years ago
ZmnSCPxj
2db6ff9186
gossip_control: Change defult fuzz of getroute to 75%.
7 years ago
ZmnSCPxj
6767434ea9
routing: Use siphash24 for route randomization
Primary idea by @rustyrussell
7 years ago
ZmnSCPxj
216c52940d
gossipd: Add fuzz and seed to getroute request.
7 years ago
ZmnSCPxj
2b782ee436
gossip_control: Add fuzz and seed parameters.
In preparation for improved route randomization.
7 years ago
practicalswift
91a9c2923f
Mark intentionally unused parameters as such (with "UNUSED")
7 years ago
practicalswift
3dbace3421
Remove redundant casts to same type
7 years ago
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>
7 years ago
Rusty Russell
a83ff83328
lightningd/connect_control: routines to control connecting (move from peer_control.c)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
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>
7 years ago
root
73022d91c6
Fix indentation
7 years ago
root
8b0ed27c43
Add optional from id parameter to getroute call.
7 years ago
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>
7 years ago
ZmnSCPxj
0d0ef2c733
gossipd: Implement gossip_mark_channel_unroutable.
Temporarily marks a channel as unroutable.
7 years ago
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>
7 years ago
ZmnSCPxj
b255d82ae2
gossipd: Implement `gossip_routing_failure` for master to report routing failures.
7 years ago
Christian Decker
61e982c6b7
gossip: Implement connection failed handler in lightningd
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
f5147f27c9
gossip: Added message for unsuccessful connection attempts
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
c6ae4b521f
gossip: Add message to enable and disable a channel
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
practicalswift
5631054152
Start all command descriptions with a verb ("Show", "Set", etc.). Remove unused help texts.
7 years ago
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>
7 years ago
Rusty Russell
7fdb30cbda
JSONRPC: rename getchannels to listchannels
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
e1e7f289fb
JSONRPC listnodes: return timestamp, alias and color.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
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>
7 years ago
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>
7 years ago
Christian Decker
7fc8e3a4e2
gossip: Pass --channel-update-interval to gossipd
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
ZmnSCPxj
83e76e3ac3
features: Move feature-handling code to a common/features.c source.
7 years ago
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>
7 years ago
Rusty Russell
e22dd5ad71
lightningd: implement gossip_get_txout/gossip_get_txout_reply.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
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>
7 years ago
Rusty Russell
a8de8a3140
json_getchannels: add public flag.
Fixes : #509
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago