peer_wire_is_internal helper.

We are now going to have messages which we know about, but yet we
don't handle ourselves.

[ I reversed this from Adi's, as that was clearer! --RR ]
This commit is contained in:
adi2011 2023-02-02 20:31:24 +10:30 committed by Alex Myers
parent 5ef49143e0
commit 66d98c327f
2 changed files with 16 additions and 1 deletions

View File

@ -120,6 +120,20 @@ bool is_unknown_msg_discardable(const u8 *cursor)
return unknown_type(t) && (t & 1);
}
/* Returns true if the message type should be handled by CLN's core */
bool peer_wire_is_internal(enum peer_wire type)
{
/* Unknown messages are not handled by CLN */
if (!peer_wire_is_defined(type))
return false;
/* handled by pluigns */
if (type == WIRE_PEER_STORAGE || type == WIRE_YOUR_PEER_STORAGE)
return false;
return true;
}
/* Extract channel_id from various packets, return true if possible. */
bool extract_channel_id(const u8 *in_pkt, struct channel_id *channel_id)
{

View File

@ -23,7 +23,8 @@
bool is_unknown_msg_discardable(const u8 *cursor);
/* Return true if it's a message for gossipd. */
bool is_msg_for_gossipd(const u8 *cursor);
/* Returns true if the message type should be treated as a custommsg */
bool peer_wire_is_internal(enum peer_wire type);
/* Extract channel_id from various packets, return true if possible. */
bool extract_channel_id(const u8 *in_pkt, struct channel_id *channel_id);