mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
ab9d9ef3b8
(This was sitting in my gossip-enchancement patch queue, but it simplifies
this set too, so I moved it here).
In 94711969f
we added an explicit gossip_index so when gossipd gets
peers back from other daemons, it knows what gossip it has sent (since
gossipd can send gossip after the other daemon is already complete).
This solution is insufficient for the more general case where gossipd
wants to send other messages reliably, so replace it with the other
solution: have gossipd drain the "gossip fd" which the daemon returns.
This turns out to be quite simple, and is probably how I should have
done it originally :(
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
46 lines
1.5 KiB
C
46 lines
1.5 KiB
C
#ifndef LIGHTNING_LIGHTNINGD_OPENING_CONTROL_H
|
|
#define LIGHTNING_LIGHTNINGD_OPENING_CONTROL_H
|
|
#include "config.h"
|
|
#include <ccan/short_types/short_types.h>
|
|
|
|
struct channel_id;
|
|
struct crypto_state;
|
|
struct json_result;
|
|
struct lightningd;
|
|
struct pubkey;
|
|
struct uncommitted_channel;
|
|
struct wireaddr;
|
|
|
|
void json_add_uncommitted_channel(struct json_result *response,
|
|
const struct uncommitted_channel *uc);
|
|
|
|
/* Peer has spontaneously exited from gossip due to open msg. Return
|
|
* NULL if we took over, otherwise hand back to gossipd with this
|
|
* error (allocated off @ctx).
|
|
*/
|
|
u8 *peer_accept_channel(const tal_t *ctx,
|
|
struct lightningd *ld,
|
|
const struct pubkey *peer_id,
|
|
const struct wireaddr *addr,
|
|
const struct crypto_state *cs,
|
|
const u8 *gfeatures, const u8 *lfeatures,
|
|
int peer_fd, int gossip_fd,
|
|
const struct channel_id *channel_id,
|
|
const u8 *open_msg);
|
|
|
|
/* Gossipd spat out peer: were we currently asking gossipd to release it
|
|
* so we could open a channel? Returns true if it took over. */
|
|
bool handle_opening_channel(struct lightningd *ld,
|
|
const struct pubkey *id,
|
|
const struct wireaddr *addr,
|
|
const struct crypto_state *cs,
|
|
const u8 *gfeatures, const u8 *lfeatures,
|
|
int peer_fd, int gossip_fd);
|
|
|
|
void kill_uncommitted_channel(struct uncommitted_channel *uc,
|
|
const char *why);
|
|
|
|
void tell_gossipd_peer_is_important(struct lightningd *ld,
|
|
const struct channel *channel);
|
|
#endif /* LIGHTNING_LIGHTNINGD_OPENING_CONTROL_H */
|