This lets us do more flexible filtering in the next patch. But it also keeps some weird logic out of gossipd. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5.4 KiB
5.4 KiB
| 1 | #include <common/cryptomsg.h> | ||||
|---|---|---|---|---|---|
| 2 | #include <common/wireaddr.h> | ||||
| 3 | #include <wire/gen_onion_wire.h> | ||||
| 4 | # Initialize the gossip daemon. | ||||
| 5 | msgtype | gossipctl_init | 3000 | ||
| 6 | msgdata | gossipctl_init | chainparams | chainparams | |
| 7 | msgdata | gossipctl_init | id | node_id | |
| 8 | msgdata | gossipctl_init | gflen | u16 | |
| 9 | msgdata | gossipctl_init | globalfeatures | u8 | gflen |
| 10 | msgdata | gossipctl_init | rgb | u8 | 3 |
| 11 | msgdata | gossipctl_init | alias | u8 | 32 |
| 12 | msgdata | gossipctl_init | num_announcable | u16 | |
| 13 | msgdata | gossipctl_init | announcable | wireaddr | num_announcable |
| 14 | msgdata | gossipctl_init | dev_gossip_time | ?u32 | |
| 15 | msgdata | gossipctl_init | dev_fast_gossip | bool | |
| 16 | msgdata | gossipctl_init | dev_fast_gossip_prune | bool | |
| 17 | # In developer mode | we can mess with time. | |||
| 18 | msgtype | gossip_dev_set_time | 3001 | ||
| 19 | msgdata | gossip_dev_set_time | dev_gossip_time | u32 | |
| 20 | # Pass JSON-RPC getnodes call through | ||||
| 21 | msgtype | gossip_getnodes_request | 3005 | ||
| 22 | msgdata | gossip_getnodes_request | id | ?node_id | |
| 23 | #include <lightningd/gossip_msg.h> | ||||
| 24 | msgtype | gossip_getnodes_reply | 3105 | ||
| 25 | msgdata | gossip_getnodes_reply | num_nodes | u32 | |
| 26 | msgdata | gossip_getnodes_reply | nodes | gossip_getnodes_entry | num_nodes |
| 27 | # Pass JSON-RPC getroute call through | ||||
| 28 | msgtype | gossip_getroute_request | 3006 | ||
| 29 | msgdata | gossip_getroute_request | source | ?node_id | |
| 30 | msgdata | gossip_getroute_request | destination | node_id | |
| 31 | msgdata | gossip_getroute_request | msatoshi | amount_msat | |
| 32 | # We don't pass doubles | so pass riskfactor 1000000. | |||
| 33 | msgdata | gossip_getroute_request | riskfactor_by_million | u64 | |
| 34 | msgdata | gossip_getroute_request | final_cltv | u32 | |
| 35 | msgdata | gossip_getroute_request | fuzz | double | |
| 36 | msgdata | gossip_getroute_request | num_excluded | u16 | |
| 37 | msgdata | gossip_getroute_request | excluded | exclude_entry | num_excluded |
| 38 | msgdata | gossip_getroute_request | max_hops | u32 | |
| 39 | msgtype | gossip_getroute_reply | 3106 | ||
| 40 | msgdata | gossip_getroute_reply | num_hops | u16 | |
| 41 | msgdata | gossip_getroute_reply | hops | route_hop | num_hops |
| 42 | msgtype | gossip_getchannels_request | 3007 | ||
| 43 | msgdata | gossip_getchannels_request | short_channel_id | ?short_channel_id | |
| 44 | msgdata | gossip_getchannels_request | source | ?node_id | |
| 45 | msgdata | gossip_getchannels_request | prev | ?short_channel_id | |
| 46 | msgtype | gossip_getchannels_reply | 3107 | ||
| 47 | msgdata | gossip_getchannels_reply | complete | bool | |
| 48 | msgdata | gossip_getchannels_reply | num_channels | u32 | |
| 49 | msgdata | gossip_getchannels_reply | nodes | gossip_getchannels_entry | num_channels |
| 50 | # Ping/pong test. Waits for a reply if it expects one. | ||||
| 51 | msgtype | gossip_ping | 3008 | ||
| 52 | msgdata | gossip_ping | id | node_id | |
| 53 | msgdata | gossip_ping | num_pong_bytes | u16 | |
| 54 | msgdata | gossip_ping | len | u16 | |
| 55 | msgtype | gossip_ping_reply | 3108 | ||
| 56 | msgdata | gossip_ping_reply | id | node_id | |
| 57 | # False if id in gossip_ping was unknown. | ||||
| 58 | msgdata | gossip_ping_reply | sent | bool | |
| 59 | # 0 == no pong expected | ||||
| 60 | msgdata | gossip_ping_reply | totlen | u16 | |
| 61 | # Set artificial maximum reply_channel_range size. Master->gossipd | ||||
| 62 | msgtype | gossip_dev_set_max_scids_encode_size | 3030 | ||
| 63 | msgdata | gossip_dev_set_max_scids_encode_size | max | u32 | |
| 64 | # Given a short_channel_id | return the other endpoint (or none if DNE) | |||
| 65 | msgtype | gossip_get_channel_peer | 3009 | ||
| 66 | msgdata | gossip_get_channel_peer | channel_id | short_channel_id | |
| 67 | msgtype | gossip_get_channel_peer_reply | 3109 | ||
| 68 | msgdata | gossip_get_channel_peer_reply | peer_id | ?node_id | |
| 69 | # gossipd->master: we're closing this channel. | ||||
| 70 | msgtype | gossip_local_channel_close | 3027 | ||
| 71 | msgdata | gossip_local_channel_close | short_channel_id | short_channel_id | |
| 72 | # Gossipd->master get this tx output please. | ||||
| 73 | msgtype | gossip_get_txout | 3018 | ||
| 74 | msgdata | gossip_get_txout | short_channel_id | short_channel_id | |
| 75 | # master->gossipd here is the output | or empty if none. | |||
| 76 | msgtype | gossip_get_txout_reply | 3118 | ||
| 77 | msgdata | gossip_get_txout_reply | short_channel_id | short_channel_id | |
| 78 | msgdata | gossip_get_txout_reply | satoshis | amount_sat | |
| 79 | msgdata | gossip_get_txout_reply | len | u16 | |
| 80 | msgdata | gossip_get_txout_reply | outscript | u8 | len |
| 81 | # master->gossipd an htlc failed with this onion error. | ||||
| 82 | msgtype | gossip_payment_failure | 3021 | ||
| 83 | msgdata | gossip_payment_failure | erring_node | node_id | |
| 84 | msgdata | gossip_payment_failure | erring_channel | short_channel_id | |
| 85 | msgdata | gossip_payment_failure | erring_channel_direction | u8 | |
| 86 | msgdata | gossip_payment_failure | len | u16 | |
| 87 | msgdata | gossip_payment_failure | error | u8 | len |
| 88 | # master -> gossipd: a potential funding outpoint was spent | please forget the eventual channel | |||
| 89 | msgtype | gossip_outpoint_spent | 3024 | ||
| 90 | msgdata | gossip_outpoint_spent | short_channel_id | short_channel_id | |
| 91 | # master -> gossipd: stop gossip timers. | ||||
| 92 | msgtype | gossip_dev_suppress | 3032 | ||
| 93 | # master -> gossipd: do you have a memleak? | ||||
| 94 | msgtype | gossip_dev_memleak | 3033 | ||
| 95 | msgtype | gossip_dev_memleak_reply | 3133 | ||
| 96 | msgdata | gossip_dev_memleak_reply | leak | bool | |
| 97 | # master -> gossipd: please rewrite the gossip_store | ||||
| 98 | msgtype | gossip_dev_compact_store | 3034 | ||
| 99 | # gossipd -> master: ok | ||||
| 100 | msgtype | gossip_dev_compact_store_reply | 3134 | ||
| 101 | msgdata | gossip_dev_compact_store_reply | success | bool | |
| 102 | #include <common/bolt11.h> | ||||
| 103 | # master -> gossipd: get route_info for our incoming channels | ||||
| 104 | msgtype | gossip_get_incoming_channels | 3025 | ||
| 105 | # gossipd -> master: here they are. | ||||
| 106 | msgtype | gossip_get_incoming_channels_reply | 3125 | ||
| 107 | msgdata | gossip_get_incoming_channels_reply | num_public | u16 | |
| 108 | msgdata | gossip_get_incoming_channels_reply | public_route_info | route_info | num_public |
| 109 | msgdata | gossip_get_incoming_channels_reply | public_deadends | bool | num_public |
| 110 | msgdata | gossip_get_incoming_channels_reply | num_private | u16 | |
| 111 | msgdata | gossip_get_incoming_channels_reply | private_route_info | route_info | num_private |
| 112 | msgdata | gossip_get_incoming_channels_reply | private_deadends | bool | num_private |
| 113 | # master -> gossipd: blockheight increased. | ||||
| 114 | msgtype | gossip_new_blockheight | 3026 | ||
| 115 | msgdata | gossip_new_blockheight | blockheight | u32 |