Browse Source

gossipd: add a BOLT#7 comment when wrong chain_hash in 'query_channel_range'

And correct some typos
travis-debug
darosior 5 years ago
committed by neil saitug
parent
commit
d3c8225968
  1. 11
      gossipd/queries.c

11
gossipd/queries.c

@ -556,7 +556,7 @@ wont_fit:
tail_blocks, query_option_flags); tail_blocks, query_option_flags);
} }
/*~ The peer can ask for all channels is a series of blocks. We reply with one /*~ The peer can ask for all channels in a series of blocks. We reply with one
* or more messages containing the short_channel_ids. */ * or more messages containing the short_channel_ids. */
const u8 *handle_query_channel_range(struct peer *peer, const u8 *msg) const u8 *handle_query_channel_range(struct peer *peer, const u8 *msg)
{ {
@ -580,8 +580,13 @@ const u8 *handle_query_channel_range(struct peer *peer, const u8 *msg)
else else
query_option_flags = 0; query_option_flags = 0;
/* If they ask for the wrong chain, we give an empty response /* BOLT #7
* with the `complete` flag unset */ *
* The receiver of `query_channel_range`:
* ...
* - if does not maintain up-to-date channel information for `chain_hash`:
* - MUST set `complete` to 0.
*/
if (!bitcoin_blkid_eq(&peer->daemon->chain_hash, &chain_hash)) { if (!bitcoin_blkid_eq(&peer->daemon->chain_hash, &chain_hash)) {
status_debug("%s sent query_channel_range chainhash %s", status_debug("%s sent query_channel_range chainhash %s",
type_to_string(tmpctx, struct node_id, &peer->id), type_to_string(tmpctx, struct node_id, &peer->id),

Loading…
Cancel
Save