Browse Source

wire: Update to lastest BOLT draft.

This includes the gossip query messages.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 6 years ago
parent
commit
6c6da45f53
  1. 5
      channeld/channel.c
  2. 8
      gossipd/gossip.c
  3. 22
      wire/gen_peer_wire_csv
  4. 10
      wire/peer_wire.c

5
channeld/channel.c

@ -1591,6 +1591,11 @@ static void peer_in(struct peer *peer, const u8 *msg)
case WIRE_CHANNEL_ANNOUNCEMENT:
case WIRE_CHANNEL_UPDATE:
case WIRE_NODE_ANNOUNCEMENT:
case WIRE_QUERY_SHORT_CHANNEL_IDS:
case WIRE_QUERY_CHANNEL_RANGE:
case WIRE_REPLY_CHANNEL_RANGE:
case WIRE_GOSSIP_TIMESTAMP_FILTER:
case WIRE_REPLY_SHORT_CHANNEL_IDS_END:
case WIRE_PING:
case WIRE_ERROR:
abort();

8
gossipd/gossip.c

@ -810,6 +810,14 @@ static struct io_plan *peer_msgin(struct io_conn *conn,
/* This will wait. */
return peer_next_in(conn, peer);
case WIRE_QUERY_SHORT_CHANNEL_IDS:
case WIRE_REPLY_SHORT_CHANNEL_IDS_END:
case WIRE_QUERY_CHANNEL_RANGE:
case WIRE_REPLY_CHANNEL_RANGE:
case WIRE_GOSSIP_TIMESTAMP_FILTER:
/* FIXME: Implement */
return peer_next_in(conn, peer);
}
/* BOLT #1:

22
wire/gen_peer_wire_csv

@ -146,3 +146,25 @@ channel_update,110,cltv_expiry_delta,2
channel_update,112,htlc_minimum_msat,8
channel_update,120,fee_base_msat,4
channel_update,124,fee_proportional_millionths,4
query_short_channel_ids,261
query_short_channel_ids,0,chain_hash,32
query_short_channel_ids,32,len,2
query_short_channel_ids,34,encoded_short_ids,len
reply_short_channel_ids_end,262
reply_short_channel_ids_end,0,chain_hash,32
reply_short_channel_ids_end,32,complete,1
query_channel_range,263
query_channel_range,0,chain_hash,32
query_channel_range,32,first_blocknum,4
query_channel_range,36,number_of_blocks,4
reply_channel_range,264
reply_channel_range,0,chain_hash,32
reply_channel_range,32,first_blocknum,4
reply_channel_range,36,number_of_blocks,4
reply_channel_range,40,complete,1
reply_channel_range,41,len,2
reply_channel_range,43,encoded_short_ids,len
gossip_timestamp_filter,265
gossip_timestamp_filter,0,chain_hash,32
gossip_timestamp_filter,32,first_timestamp,4
gossip_timestamp_filter,36,timestamp_range,4

10
wire/peer_wire.c

@ -26,6 +26,11 @@ static bool unknown_type(enum wire_type t)
case WIRE_CHANNEL_UPDATE:
case WIRE_PING:
case WIRE_PONG:
case WIRE_QUERY_SHORT_CHANNEL_IDS:
case WIRE_REPLY_SHORT_CHANNEL_IDS_END:
case WIRE_QUERY_CHANNEL_RANGE:
case WIRE_REPLY_CHANNEL_RANGE:
case WIRE_GOSSIP_TIMESTAMP_FILTER:
return false;
}
return true;
@ -37,6 +42,11 @@ bool is_msg_for_gossipd(const u8 *cursor)
case WIRE_CHANNEL_ANNOUNCEMENT:
case WIRE_NODE_ANNOUNCEMENT:
case WIRE_CHANNEL_UPDATE:
case WIRE_QUERY_SHORT_CHANNEL_IDS:
case WIRE_REPLY_SHORT_CHANNEL_IDS_END:
case WIRE_QUERY_CHANNEL_RANGE:
case WIRE_REPLY_CHANNEL_RANGE:
case WIRE_GOSSIP_TIMESTAMP_FILTER:
return true;
case WIRE_INIT:
case WIRE_ERROR:

Loading…
Cancel
Save