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.
This commit is contained in:
Christian Decker
2019-12-04 23:02:54 +01:00
parent b18c1ea543
commit 9fd84169bb

View File

@@ -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;