2019-09-22 15:23:42 +09:30
|
|
|
#ifndef LIGHTNING_GOSSIPD_QUERIES_H
|
|
|
|
#define LIGHTNING_GOSSIPD_QUERIES_H
|
|
|
|
#include "config.h"
|
|
|
|
#include <ccan/short_types/short_types.h>
|
|
|
|
|
2019-10-08 11:53:24 +10:30
|
|
|
struct channel_update_timestamps;
|
2019-09-22 15:23:42 +09:30
|
|
|
struct daemon;
|
|
|
|
struct io_conn;
|
|
|
|
struct peer;
|
2024-01-31 13:46:19 +10:30
|
|
|
struct range_query_reply;
|
2019-09-22 15:23:42 +09:30
|
|
|
struct short_channel_id;
|
|
|
|
|
2024-07-09 22:45:29 +09:30
|
|
|
/* Various handlers when peer fwds a gossip query reply msg: return is NULL or
|
2019-09-22 15:23:42 +09:30
|
|
|
* error packet. */
|
|
|
|
const u8 *handle_reply_short_channel_ids_end(struct peer *peer, const u8 *msg);
|
|
|
|
const u8 *handle_reply_channel_range(struct peer *peer, const u8 *msg);
|
|
|
|
|
2019-09-30 14:27:12 +09:30
|
|
|
/* Ask this peer for a range of scids. Must support it, and not already
|
|
|
|
* have a query pending. */
|
|
|
|
bool query_channel_range(struct daemon *daemon,
|
|
|
|
struct peer *peer,
|
|
|
|
u32 first_blocknum, u32 number_of_blocks,
|
2019-10-08 11:52:24 +10:30
|
|
|
enum query_option_flags qflags,
|
2022-07-25 16:30:09 +09:30
|
|
|
void (*cb)(struct peer *peer_,
|
|
|
|
u32 first_blocknum_,
|
|
|
|
u32 number_of_blocks_,
|
|
|
|
const struct range_query_reply *replies_));
|
2019-09-30 14:27:12 +09:30
|
|
|
|
2019-10-08 11:51:24 +10:30
|
|
|
/* Ask this peer for info about an array of scids, with optional query_flags */
|
2019-10-08 11:45:24 +10:30
|
|
|
bool query_short_channel_ids(struct daemon *daemon,
|
|
|
|
struct peer *peer,
|
|
|
|
const struct short_channel_id *scids,
|
2019-10-08 11:51:24 +10:30
|
|
|
const u8 *query_flags,
|
2022-07-25 16:30:09 +09:30
|
|
|
void (*cb)(struct peer *peer_, bool complete));
|
2019-10-08 11:45:24 +10:30
|
|
|
|
2019-09-22 15:23:42 +09:30
|
|
|
#endif /* LIGHTNING_GOSSIPD_QUERIES_H */
|