mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
common/per_per_state: generalize lightningd/peer_comm Part 1
Encapsulating the peer state was a win for lightningd; not surprisingly, it's even more of a win for the other daemons, especially as we want to add a little gossip information. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -162,20 +162,18 @@ static NORETURN void flush_and_exit(int reason)
|
||||
exit(0x80 | (reason & 0xFF));
|
||||
}
|
||||
|
||||
void status_send_fatal(const u8 *msg TAKES, int fd1, int fd2, int fd3)
|
||||
void status_send_fd(int fd)
|
||||
{
|
||||
assert(!status_conn);
|
||||
fdpass_send(status_fd, fd);
|
||||
}
|
||||
|
||||
void status_send_fatal(const u8 *msg TAKES)
|
||||
{
|
||||
int reason = fromwire_peektype(msg);
|
||||
breakpoint();
|
||||
status_send(msg);
|
||||
|
||||
/* We don't support async fd passing here. */
|
||||
if (fd1 != -1) {
|
||||
assert(!status_conn);
|
||||
fdpass_send(status_fd, fd1);
|
||||
fdpass_send(status_fd, fd2);
|
||||
fdpass_send(status_fd, fd3);
|
||||
}
|
||||
|
||||
flush_and_exit(reason);
|
||||
}
|
||||
|
||||
@@ -193,8 +191,7 @@ void status_failed(enum status_failreason reason, const char *fmt, ...)
|
||||
if (reason == STATUS_FAIL_INTERNAL_ERROR)
|
||||
send_backtrace(str);
|
||||
|
||||
status_send_fatal(take(towire_status_fail(NULL, reason, str)),
|
||||
-1, -1, -1);
|
||||
status_send_fatal(take(towire_status_fail(NULL, reason, str)));
|
||||
}
|
||||
|
||||
void master_badmsg(u32 type_expected, const u8 *msg)
|
||||
|
||||
Reference in New Issue
Block a user