Browse Source

peer_control: annotate feature bitfields as being taken.

Because tal_dup_arr takes, this does too.

Suggested-by: @cdecker
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
parent
commit
641b33349b
  1. 2
      lightningd/peer_control.c
  2. 2
      lightningd/peer_control.h

2
lightningd/peer_control.c

@ -81,7 +81,7 @@ static void copy_to_parent_log(const char *prefix,
struct peer *new_peer(struct lightningd *ld, u64 dbid,
const struct pubkey *id,
const struct wireaddr_internal *addr,
const u8 *gfeatures, const u8 *lfeatures)
const u8 *gfeatures TAKES, const u8 *lfeatures TAKES)
{
/* We are owned by our channels, and freed manually by destroy_channel */
struct peer *peer = tal(NULL, struct peer);

2
lightningd/peer_control.h

@ -58,7 +58,7 @@ struct peer *find_peer_by_dbid(struct lightningd *ld, u64 dbid);
struct peer *new_peer(struct lightningd *ld, u64 dbid,
const struct pubkey *id,
const struct wireaddr_internal *addr,
const u8 *gfeatures, const u8 *lfeatures);
const u8 *gfeatures TAKES, const u8 *lfeatures TAKES);
/* Also removes from db. */
void delete_peer(struct peer *peer);

Loading…
Cancel
Save