core-lightning/tools
Rusty Russell 38d229df3d tools/generate-wire.py: make sure TLV array fields are allocated off TLV.
Otherwise the whole thing cannot be tal_steal() onto a different parent.

Here's the difference in generated files:

   --- ./wire/onion_wiregen.c.pre	2024-10-23 12:26:09.023176933 +1030
   +++ ./wire/onion_wiregen.c	2024-10-23 12:26:52.434828303 +1030
   @@ -128,7 +128,7 @@
     	blinded_path->path = num_hops ? tal_arr(blinded_path, struct blinded_path_hop *, 0) : NULL;
    	for (size_t i = 0; i < num_hops; i++) {
    		struct blinded_path_hop * tmp;
   -		tmp = fromwire_blinded_path_hop(blinded_path, cursor, plen);
   +		tmp = fromwire_blinded_path_hop(blinded_path->path, cursor, plen);
    		tal_arr_expand(&blinded_path->path, tmp);
    	}
    
   --- ./wire/bolt12_wiregen.c.pre	2024-10-23 12:26:09.079176474 +1030
   +++ ./wire/bolt12_wiregen.c	2024-10-23 12:26:52.612826902 +1030
   @@ -316,7 +316,7 @@
    	r->offer_paths = *plen ? tal_arr(r, struct blinded_path *, 0) : NULL;
    	while (*plen != 0) {
    		struct blinded_path * tmp;
   -		tmp = fromwire_blinded_path(r, cursor, plen);
   +		tmp = fromwire_blinded_path(r->offer_paths, cursor, plen);
    		tal_arr_expand(&r->offer_paths, tmp);
    	}
    }
   @@ -729,7 +729,7 @@
    	r->offer_paths = *plen ? tal_arr(r, struct blinded_path *, 0) : NULL;
    	while (*plen != 0) {
    		struct blinded_path * tmp;
   -		tmp = fromwire_blinded_path(r, cursor, plen);
   +		tmp = fromwire_blinded_path(r->offer_paths, cursor, plen);
    		tal_arr_expand(&r->offer_paths, tmp);
    	}
    }
   @@ -1052,7 +1052,7 @@
    	r->invreq_paths = *plen ? tal_arr(r, struct blinded_path *, 0) : NULL;
    	while (*plen != 0) {
    		struct blinded_path * tmp;
   -		tmp = fromwire_blinded_path(r, cursor, plen);
   +		tmp = fromwire_blinded_path(r->invreq_paths, cursor, plen);
    		tal_arr_expand(&r->invreq_paths, tmp);
    	}
    }
   @@ -1385,7 +1385,7 @@
    	r->offer_paths = *plen ? tal_arr(r, struct blinded_path *, 0) : NULL;
    	while (*plen != 0) {
    		struct blinded_path * tmp;
   -		tmp = fromwire_blinded_path(r, cursor, plen);
   +		tmp = fromwire_blinded_path(r->offer_paths, cursor, plen);
    		tal_arr_expand(&r->offer_paths, tmp);
    	}
    }
   @@ -1708,7 +1708,7 @@
    	r->invreq_paths = *plen ? tal_arr(r, struct blinded_path *, 0) : NULL;
    	while (*plen != 0) {
    		struct blinded_path * tmp;
   -		tmp = fromwire_blinded_path(r, cursor, plen);
   +		tmp = fromwire_blinded_path(r->invreq_paths, cursor, plen);
    		tal_arr_expand(&r->invreq_paths, tmp);
    	}
    }
   @@ -1781,7 +1781,7 @@
    	r->invoice_paths = *plen ? tal_arr(r, struct blinded_path *, 0) : NULL;
    	while (*plen != 0) {
    		struct blinded_path * tmp;
   -		tmp = fromwire_blinded_path(r, cursor, plen);
   +		tmp = fromwire_blinded_path(r->invoice_paths, cursor, plen);
    		tal_arr_expand(&r->invoice_paths, tmp);
    	}
    }
   @@ -1808,7 +1808,7 @@
    	r->invoice_blindedpay = *plen ? tal_arr(r, struct blinded_payinfo *, 0) : NULL;
    	while (*plen != 0) {
    		struct blinded_payinfo * tmp;
   -		tmp = fromwire_blinded_payinfo(r, cursor, plen);
   +		tmp = fromwire_blinded_payinfo(r->invoice_blindedpay, cursor, plen);
    		tal_arr_expand(&r->invoice_blindedpay, tmp);
    	}
    }
   @@ -1927,7 +1927,7 @@
    	r->invoice_fallbacks = *plen ? tal_arr(r, struct fallback_address *, 0) : NULL;
    	while (*plen != 0) {
    		struct fallback_address * tmp;
   -		tmp = fromwire_fallback_address(r, cursor, plen);
   +		tmp = fromwire_fallback_address(r->invoice_fallbacks, cursor, plen);
    		tal_arr_expand(&r->invoice_fallbacks, tmp);
    	}
    }
   
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-11-18 11:03:26 +10:30
..
gen tools/generate-wire.py: make sure TLV array fields are allocated off TLV. 2024-11-18 11:03:26 +10:30
test tools: remove DEVELOPER. 2023-09-21 20:08:24 +09:30
.gitignore reorganize .gitignore entries across subdirs. 2021-05-18 09:43:50 +09:30
bench-gossipd.sh devtools/gossipwith: use timestamp filter message not obsolete INIT_ROUTING_SYNC. 2024-06-19 15:54:24 +09:30
build-release.sh script: Added caching option for docker publish and shellcheck fixes 2024-06-13 11:43:37 +09:30
check-bolt.c tools/check-bolt: rewrite to give more accurate diagnostics when we're out of sync. 2024-06-19 15:54:24 +09:30
check-includes.sh tools/check-includes.sh: make shellcheck happy. 2021-12-06 10:05:39 +10:30
check-manpage.sh lightningd: add --developer runtime option. 2023-09-21 20:08:24 +09:30
check-setup_locale.sh setup: add setup to make checks 2020-05-19 13:35:42 +09:30
check-spelling.sh tools: allow spelling of HtlcTlv 2024-05-17 16:30:43 +02:00
docker-entrypoint.sh Docker: run directory for post-start if present. 2023-03-23 16:43:07 +10:30
fromschema.py script: Auto generate rpc examples for documentation 2024-08-09 23:56:45 -07:00
generate-wire.py bitcoin/short_channel_id: pass by copy everywhere. 2024-03-20 13:51:48 +10:30
headerversions.c gossipd: drop zlib support. 2024-07-10 12:21:19 +09:30
hsmtool.c pytest: fix hsmtool which reports leak under address sanitizer. 2024-11-17 14:09:10 +10:30
Makefile make: Change mv to mv -f when replacing tools/headerversions file 2024-10-14 15:00:36 +10:30
md2man.sh docs: Removed example usage 2024-06-22 17:02:33 +02:00
mockup.sh update-mocks: handle missing deprecated_apis. 2022-07-09 09:59:52 +09:30
reckless reckless: correct logging levels 2024-08-08 11:33:39 +09:30
refresh-submodules.sh make: have git submodule update be recursive 2020-12-11 13:20:54 +01:00
repro-build.sh github: Read tag on HEAD in Github Actions 2024-09-05 12:31:49 -07:00
update-mocks.sh tools: make sure we don't use optimization when building mocks. 2023-10-23 15:48:50 +10:30