We handle pings and gossip messages. */
| 738 | |
| 739 | /* We handle pings and gossip messages. */ |
| 740 | static bool handle_message_locally(struct peer *peer, const u8 *msg) |
| 741 | { |
| 742 | enum peer_wire type = fromwire_peektype(msg); |
| 743 | |
| 744 | /* We remember these so we don't rexmit them */ |
| 745 | gossip_rcvd_filter_add(peer->gs.grf, msg); |
| 746 | |
| 747 | if (type == WIRE_GOSSIP_TIMESTAMP_FILTER) { |
| 748 | handle_gossip_timestamp_filter_in(peer, msg); |
| 749 | return true; |
| 750 | } else if (type == WIRE_PING) { |
| 751 | handle_ping_in(peer, msg); |
| 752 | return true; |
| 753 | } else if (type == WIRE_PONG) { |
| 754 | handle_pong_in(peer, msg); |
| 755 | return true; |
| 756 | } else if (type == WIRE_ONION_MESSAGE) { |
| 757 | handle_onion_message(peer->daemon, peer, msg); |
| 758 | return true; |
| 759 | } else if (handle_custommsg(peer->daemon, peer, msg)) { |
| 760 | return true; |
| 761 | } |
| 762 | |
| 763 | /* Do we want to divert to gossipd? */ |
| 764 | if (is_msg_for_gossipd(msg)) { |
| 765 | handle_gossip_in(peer, msg); |
| 766 | return true; |
| 767 | } |
| 768 | |
| 769 | return false; |
| 770 | } |
| 771 | |
| 772 | /* Move "channel_id" to temporary. */ |
| 773 | static void move_channel_id_to_temp(struct subd *subd) |
no test coverage detected