Browse Source

common: Add an assertion for custommsgs in gossip handler

This is mainly meant as a marker so that we can later remove the code if we
decide to make the handling of custommsgs a non-developer option. It marks the
place that we would otherwise handle what in dev-mode is a custommsg.
travis-debug
Christian Decker 5 years ago
parent
commit
9fd84169bb
  1. 7
      common/read_peer_msg.c

7
common/read_peer_msg.c

@ -1,3 +1,4 @@
#include <assert.h>
#include <ccan/fdpass/fdpass.h>
#include <common/crypto_sync.h>
#include <common/gossip_rcvd_filter.h>
@ -155,6 +156,11 @@ bool handle_peer_gossip_or_error(struct per_peer_state *pps,
bool all_channels;
struct channel_id actual;
#if DEVELOPER
/* Any odd-typed unknown message is handled by the caller, so if we
* find one here it's an error. */
assert(!is_unknown_msg_discardable(msg));
#else
/* BOLT #1:
*
* A receiving node:
@ -163,6 +169,7 @@ bool handle_peer_gossip_or_error(struct per_peer_state *pps,
*/
if (is_unknown_msg_discardable(msg))
goto handled;
#endif
if (handle_timestamp_filter(pps, msg))
return true;

Loading…
Cancel
Save