mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-06 07:34:21 +01:00
tools/generate_wire.py: make functions allocate the TLV.
Requiring the caller to allocate them is ugly, and differs from other types. This means we need a context arg if we don't have one already. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -47,7 +47,7 @@ static struct io_plan *peer_init_received(struct io_conn *conn,
|
||||
{
|
||||
u8 *msg = cryptomsg_decrypt_body(tmpctx, &peer->cs, peer->msg);
|
||||
u8 *globalfeatures, *features;
|
||||
struct tlv_init_tlvs *tlvs = tlv_init_tlvs_new(msg);
|
||||
struct tlv_init_tlvs *tlvs;
|
||||
struct wireaddr *remote_addr;
|
||||
|
||||
if (!msg)
|
||||
@@ -64,7 +64,7 @@ static struct io_plan *peer_init_received(struct io_conn *conn,
|
||||
if (unlikely(is_unknown_msg_discardable(msg)))
|
||||
return read_init(conn, peer);
|
||||
|
||||
if (!fromwire_init(tmpctx, msg, &globalfeatures, &features, tlvs)) {
|
||||
if (!fromwire_init(tmpctx, msg, &globalfeatures, &features, &tlvs)) {
|
||||
status_peer_debug(&peer->id,
|
||||
"bad fromwire_init '%s', closing",
|
||||
tal_hex(tmpctx, msg));
|
||||
|
||||
Reference in New Issue
Block a user