gossipd: hand a gossip_store_fd to all subdaemons.

This will let them read from the gossip store directly.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2019-05-04 15:23:13 +09:30
parent eaac0d7105
commit 13717c6ebb
24 changed files with 114 additions and 61 deletions

View File

@@ -12,18 +12,19 @@ struct channel_id;
* @channel_id: channel with error, or NULL for all.
* @fmt...: format as per status_failed(STATUS_FAIL_PEER_BAD)
*/
#define peer_failed(cs, channel_id, ...) \
peer_failed_(PEER_FD, GOSSIP_FD, (cs), (channel_id), __VA_ARGS__)
#define peer_failed(cs, channel_id, ...) \
peer_failed_(PEER_FD, GOSSIP_FD, GOSSIP_STORE_FD, \
(cs), (channel_id), __VA_ARGS__)
void peer_failed_(int peer_fd, int gossip_fd,
void peer_failed_(int peer_fd, int gossip_fd, int gossip_store_fd,
struct crypto_state *cs,
const struct channel_id *channel_id,
const char *fmt, ...)
PRINTF_FMT(5,6) NORETURN;
PRINTF_FMT(6,7) NORETURN;
/* We're failing because peer sent us an error message: NULL
* channel_id means all channels. */
void peer_failed_received_errmsg(int peer_fd, int gossip_fd,
void peer_failed_received_errmsg(int peer_fd, int gossip_fd, int gossip_store_fd,
struct crypto_state *cs,
const char *desc,
const struct channel_id *channel_id) NORETURN;