2017-04-01 12:25:59 +02:00
|
|
|
#ifndef LIGHTNING_WIRE_PEER_WIRE_H
|
|
|
|
#define LIGHTNING_WIRE_PEER_WIRE_H
|
|
|
|
#include "config.h"
|
|
|
|
#include <stdbool.h>
|
2020-09-07 23:06:50 +02:00
|
|
|
|
|
|
|
#if EXPERIMENTAL_FEATURES
|
|
|
|
#include <wire/peer_exp_wiregen.h>
|
|
|
|
#else
|
2020-08-31 03:13:25 +02:00
|
|
|
#include <wire/peer_wiregen.h>
|
2020-09-07 23:06:50 +02:00
|
|
|
#endif
|
2017-04-01 12:25:59 +02:00
|
|
|
|
|
|
|
/* BOLT #1:
|
|
|
|
*
|
2018-06-17 12:13:44 +02:00
|
|
|
* A receiving node:
|
|
|
|
* - upon receiving a message of _odd_, unknown type:
|
|
|
|
* - MUST ignore the received message.
|
|
|
|
* - upon receiving a message of _even_, unknown type:
|
2020-06-22 07:06:03 +02:00
|
|
|
* - MUST close the connection.
|
|
|
|
* - MAY fail the channels.
|
2017-04-01 12:25:59 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* Return true if it's an unknown ODD message. cursor is a tal ptr. */
|
2017-06-27 04:50:10 +02:00
|
|
|
bool is_unknown_msg_discardable(const u8 *cursor);
|
2018-03-08 04:17:05 +01:00
|
|
|
/* Return true if it's a message for gossipd. */
|
|
|
|
bool is_msg_for_gossipd(const u8 *cursor);
|
2023-02-02 11:01:24 +01:00
|
|
|
/* Returns true if the message type should be treated as a custommsg */
|
|
|
|
bool peer_wire_is_internal(enum peer_wire type);
|
2018-01-10 05:47:22 +01:00
|
|
|
/* Extract channel_id from various packets, return true if possible. */
|
|
|
|
bool extract_channel_id(const u8 *in_pkt, struct channel_id *channel_id);
|
|
|
|
|
2017-06-27 04:55:01 +02:00
|
|
|
/* BOLT #2:
|
|
|
|
*
|
|
|
|
* Only the least-significant bit of `channel_flags` is currently
|
|
|
|
* defined: `announce_channel`. This indicates whether the initiator
|
|
|
|
* of the funding flow wishes to advertise this channel publicly to
|
2018-06-17 12:13:44 +02:00
|
|
|
* the network, as detailed within [BOLT #7]
|
2017-06-27 04:55:01 +02:00
|
|
|
*/
|
2017-08-08 14:18:30 +02:00
|
|
|
#define CHANNEL_FLAGS_ANNOUNCE_CHANNEL 1
|
2017-04-01 12:25:59 +02:00
|
|
|
#endif /* LIGHTNING_WIRE_PEER_WIRE_H */
|