Rusty Russell
cc9ca82821
status: separate types for peer failure vs "impossible" failures.
Ideally we'd rename status_failed() to status_fatal(), but that's
too much churn for now.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
e34ec8da2d
peer_failed: use towire_errorfmtv() which doesn't add nul terminator.
This code was actually wrong.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
ef28b6112c
status: use common status codes for all the failures.
This change is really to allow us to have a --dev-fail-on-subdaemon-fail option
so we can handle failures from subdaemons generically.
It also neatens handling so we can have an explicit callback for "peer
did something wrong" (which matters if we want to close the channel in
that case).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
a37c165cb9
common: move some files out of lightningd/
Basically all files shared by different daemons.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
80886cda8a
daemon_conn: fix daemon_conn_sync_flush.
We need to set fd to blocking before trying to sync write. Use
io_fd_block() elsewhere, too.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago
Rusty Russell
456fa39380
sync_crypto_write: support take(msg)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago
Rusty Russell
7389aae26a
Massive BOLT text underscore and formatting updates.
This brings us up to 61b5b3f7b4145c9d6d66973b6bfbf28e6c0a0791.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago
Rusty Russell
be9bb5f9cb
lightningd: peer_fail helper to fail/reconnect peer.
This will eventually hook into restart logic.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago
Rusty Russell
4bf398c4e7
status: move into lightningd/status.
It's really a lightningd-only thing, and we're about to do surgery on it.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago
Rusty Russell
7419fde9a0
Update to new spec: differentiate channel_id and short_channel_id.
The spec 4af8e1841151f0c6e8151979d6c89d11839b2f65 uses a 32-byte 'channel-id'
field, not to be confused with the 8-byte short ID used by gossip. Rename
appropriately, and update to the new handshake protocol.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago
Rusty Russell
89af53267b
lightningd/peer_failed: helper to send PKT_ERR and exit daemon.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago