Christian Decker
11fc750383
gossip: Handle incoming client requests asynchronously
8 years ago
Christian Decker
3045e25624
gossip: Returning a gossip-client upon peer_ready
This fd is handed to the owner of the peer so that it can talk to the
gossip daemon.
8 years ago
Christian Decker
477b537bad
gossip: Do not clear peer in gossipd when it's handed off
8 years ago
Rusty Russell
5dc8cb12be
lightningd/gossip: convert to subd.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago
Christian Decker
5277787db5
gossip: Do not cleanup broadcast messages
Freeing the messages results in a use-after-free when the next peer
attempts to synchronize.
8 years ago
Rusty Russell
a845b07ada
lightningd/cryptomsg: only free written messages if they're marked take().
This fixes a leak in gossip, too.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago
Rusty Russell
fd258fe495
lightningd: wire up opening daemon.
Now we can actually open a channel.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago
Rusty Russell
edc30b12ea
lightningd: --dev-debugger=<subdaemon>
Or for blackbox tests --gdb1=<subdaemon> / --gdb2=<subdaemon>.
This makes the subdaemon wait as soon as it's execed, so we can attach
the debugger.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago
Rusty Russell
90737371d0
lightningd/cryptomsg: split raw crypto_state vs peer_crypto_state
Raw crypto_state is what we send across the wire: the peer one is for
use in async crypto io routines (peer_read_message/peer_write_message).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago
Christian Decker
8912272983
gossip: Prevent normal messages to trigger the staggered broadcast
Only call `peer_dump_gossip` if the broadcast timer actually
expired. previously it could get triggered by any normal message.
8 years ago
Christian Decker
fccab6411d
gossip: Add timer and normal queue for messages
The peer is woken up every 30 seconds to deliver the backlog of
messages. Additionally I added the normal message queue to be able to
send non-gossip message to the peer.
8 years ago
Christian Decker
83f51fe965
gossip: Add timer support to the io_loop
8 years ago
Rusty Russell
9fd40da38c
generate-wire: don't hand unknown structures specially.
It's awkward to handle them differently. But this change means we
need to expose them to the generated code.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago
Rusty Russell
4ed259c46c
gen_peer_wire_csv: update for latest spec.
We have a separate announcement_signatures message now.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago
Christian Decker
fb814a7a9e
gossip: Adding announcement handling to the gossip subdaemon.
We now have all the pieces to wire in the handling functionality to
the new gossip subdaemon.
8 years ago
Rusty Russell
21a5c62ead
lightningd_gossip: daemon to look after peers which don't a channel (yet)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago