mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +01:00
gossipd: annotate replace_broadcast that we take() the payload, make it const.
We tal_dup_arr() it, which does take. Make it const in the structure; the tal_dup_arr() removes the const, so it compiles without it, but it's misleading. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
1290f305a2
commit
b8285db263
2 changed files with 4 additions and 4 deletions
|
@ -18,7 +18,7 @@ static void destroy_queued_message(struct queued_message *msg,
|
|||
|
||||
static struct queued_message *new_queued_message(const tal_t *ctx,
|
||||
struct broadcast_state *bstate,
|
||||
const u8 *payload,
|
||||
const u8 *payload TAKES,
|
||||
u64 index)
|
||||
{
|
||||
struct queued_message *msg = tal(ctx, struct queued_message);
|
||||
|
@ -32,7 +32,7 @@ static struct queued_message *new_queued_message(const tal_t *ctx,
|
|||
bool replace_broadcast(const tal_t *ctx,
|
||||
struct broadcast_state *bstate,
|
||||
u64 *index,
|
||||
const u8 *payload)
|
||||
const u8 *payload TAKES)
|
||||
{
|
||||
struct queued_message *msg;
|
||||
bool evicted = false;
|
||||
|
|
|
@ -14,7 +14,7 @@ struct queued_message {
|
|||
u64 index;
|
||||
|
||||
/* Serialized payload */
|
||||
u8 *payload;
|
||||
const u8 *payload;
|
||||
};
|
||||
|
||||
struct broadcast_state {
|
||||
|
@ -31,7 +31,7 @@ struct broadcast_state *new_broadcast_state(tal_t *ctx);
|
|||
bool replace_broadcast(const tal_t *ctx,
|
||||
struct broadcast_state *bstate,
|
||||
u64 *index,
|
||||
const u8 *payload);
|
||||
const u8 *payload TAKES);
|
||||
|
||||
|
||||
struct queued_message *next_broadcast_message(struct broadcast_state *bstate, u64 last_index);
|
||||
|
|
Loading…
Add table
Reference in a new issue