We handle pings and gossip messages. */
| 1055 | |
| 1056 | /* We handle pings and gossip messages. */ |
| 1057 | static bool handle_message_locally(struct peer *peer, const u8 *msg) |
| 1058 | { |
| 1059 | enum peer_wire type = fromwire_peektype(msg); |
| 1060 | |
| 1061 | /* We remember these so we don't rexmit them */ |
| 1062 | gossip_rcvd_filter_add(peer->gs.grf, msg); |
| 1063 | |
| 1064 | if (type == WIRE_GOSSIP_TIMESTAMP_FILTER) { |
| 1065 | log_peer_io(peer, msg); |
| 1066 | handle_gossip_timestamp_filter_in(peer, msg); |
| 1067 | return true; |
| 1068 | } else if (type == WIRE_PING) { |
| 1069 | log_peer_io(peer, msg); |
| 1070 | handle_ping_in(peer, msg); |
| 1071 | return true; |
| 1072 | } else if (type == WIRE_PONG) { |
| 1073 | log_peer_io(peer, msg); |
| 1074 | handle_pong_in(peer, msg); |
| 1075 | return true; |
| 1076 | } else if (type == WIRE_ONION_MESSAGE) { |
| 1077 | log_peer_io(peer, msg); |
| 1078 | handle_onion_message(peer->daemon, peer, msg); |
| 1079 | return true; |
| 1080 | } else if (type == WIRE_QUERY_CHANNEL_RANGE) { |
| 1081 | handle_query_channel_range(peer, msg); |
| 1082 | return true; |
| 1083 | } else if (type == WIRE_QUERY_SHORT_CHANNEL_IDS) { |
| 1084 | handle_query_short_channel_ids(peer, msg); |
| 1085 | return true; |
| 1086 | } else if (handle_custommsg(peer->daemon, peer, msg)) { |
| 1087 | return true; |
| 1088 | } |
| 1089 | |
| 1090 | /* Do we want to divert to gossipd? */ |
| 1091 | if (is_msg_for_gossipd(msg)) { |
| 1092 | handle_gossip_in(peer, msg); |
| 1093 | return true; |
| 1094 | } |
| 1095 | |
| 1096 | return false; |
| 1097 | } |
| 1098 | |
| 1099 | /* Move "channel_id" to temporary. */ |
| 1100 | static void move_channel_id_to_temp(struct subd *subd) |
no test coverage detected