We handle pings and gossip messages. */
| 959 | |
| 960 | /* We handle pings and gossip messages. */ |
| 961 | static bool handle_message_locally(struct peer *peer, const u8 *msg) |
| 962 | { |
| 963 | enum peer_wire type = fromwire_peektype(msg); |
| 964 | |
| 965 | /* We remember these so we don't rexmit them */ |
| 966 | gossip_rcvd_filter_add(peer->gs.grf, msg); |
| 967 | |
| 968 | if (type == WIRE_GOSSIP_TIMESTAMP_FILTER) { |
| 969 | log_peer_io(peer, msg); |
| 970 | handle_gossip_timestamp_filter_in(peer, msg); |
| 971 | return true; |
| 972 | } else if (type == WIRE_PING) { |
| 973 | log_peer_io(peer, msg); |
| 974 | handle_ping_in(peer, msg); |
| 975 | return true; |
| 976 | } else if (type == WIRE_PONG) { |
| 977 | log_peer_io(peer, msg); |
| 978 | handle_pong_in(peer, msg); |
| 979 | return true; |
| 980 | } else if (type == WIRE_ONION_MESSAGE) { |
| 981 | log_peer_io(peer, msg); |
| 982 | handle_onion_message(peer->daemon, peer, msg); |
| 983 | return true; |
| 984 | } else if (type == WIRE_QUERY_CHANNEL_RANGE) { |
| 985 | handle_query_channel_range(peer, msg); |
| 986 | return true; |
| 987 | } else if (type == WIRE_QUERY_SHORT_CHANNEL_IDS) { |
| 988 | handle_query_short_channel_ids(peer, msg); |
| 989 | return true; |
| 990 | } else if (handle_custommsg(peer->daemon, peer, msg)) { |
| 991 | return true; |
| 992 | } |
| 993 | |
| 994 | /* Do we want to divert to gossipd? */ |
| 995 | if (is_msg_for_gossipd(msg)) { |
| 996 | handle_gossip_in(peer, msg); |
| 997 | return true; |
| 998 | } |
| 999 | |
| 1000 | return false; |
| 1001 | } |
| 1002 | |
| 1003 | /* Move "channel_id" to temporary. */ |
| 1004 | static void move_channel_id_to_temp(struct subd *subd) |
no test coverage detected