diff --git a/bitcoin/block.c b/bitcoin/block.c index 2d64a5759..53fc6d9d7 100644 --- a/bitcoin/block.c +++ b/bitcoin/block.c @@ -5,7 +5,7 @@ #include #include #include -#include +#include /* Sets *cursor to NULL and returns NULL when a pull fails. */ static const u8 *pull(const u8 **cursor, size_t *max, void *copy, size_t n) @@ -245,7 +245,6 @@ char *fmt_bitcoin_blkid(const tal_t *ctx, bitcoin_blkid_to_hex(blkid, hexstr, hex_str_size(sizeof(*blkid))); return hexstr; } -REGISTER_TYPE_TO_STRING(bitcoin_blkid, fmt_bitcoin_blkid); void fromwire_bitcoin_blkid(const u8 **cursor, size_t *max, struct bitcoin_blkid *blkid) diff --git a/bitcoin/locktime.c b/bitcoin/locktime.c index 5bbaedff3..f73559dc1 100644 --- a/bitcoin/locktime.c +++ b/bitcoin/locktime.c @@ -2,7 +2,6 @@ #include #include #include -#include #define SECONDS_POINT 500000000 diff --git a/bitcoin/preimage.c b/bitcoin/preimage.c index 837b70298..14594e798 100644 --- a/bitcoin/preimage.c +++ b/bitcoin/preimage.c @@ -1,6 +1,5 @@ #include "config.h" #include -#include #include #include @@ -18,5 +17,3 @@ char *fmt_preimage(const tal_t *ctx, const struct preimage *preimage) { return tal_hexstr(ctx, preimage, sizeof(*preimage)); } - -REGISTER_TYPE_TO_STRING(preimage, fmt_preimage); diff --git a/bitcoin/privkey.c b/bitcoin/privkey.c index ace556c10..c1eb9cd37 100644 --- a/bitcoin/privkey.c +++ b/bitcoin/privkey.c @@ -1,7 +1,7 @@ #include "config.h" #include #include -#include +#include #include char *fmt_privkey(const tal_t *ctx, const struct privkey *secret) @@ -12,13 +12,11 @@ char *fmt_privkey(const tal_t *ctx, const struct privkey *secret) strcat(str, "01"); return str; } -REGISTER_TYPE_TO_STRING(privkey, fmt_privkey); char *fmt_secret(const tal_t *ctx, const struct secret *secret) { return tal_hexstr(ctx, secret, sizeof(*secret)); } -REGISTER_TYPE_TO_STRING(secret, fmt_secret); bool secret_eq_consttime(const struct secret *a, const struct secret *b) { diff --git a/bitcoin/psbt.c b/bitcoin/psbt.c index 51b2f332c..12ed9030a 100644 --- a/bitcoin/psbt.c +++ b/bitcoin/psbt.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include @@ -745,7 +745,6 @@ char *fmt_wally_psbt(const tal_t *ctx, const struct wally_psbt *psbt) return serialized_psbt; } -REGISTER_TYPE_TO_STRING(wally_psbt, fmt_wally_psbt); const u8 *psbt_get_bytes(const tal_t *ctx, const struct wally_psbt *psbt, size_t *bytes_written) diff --git a/bitcoin/pubkey.c b/bitcoin/pubkey.c index 9e0492a96..3d1a0432f 100644 --- a/bitcoin/pubkey.c +++ b/bitcoin/pubkey.c @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #ifndef SUPERVERBOSE @@ -69,7 +69,6 @@ char *fmt_pubkey(const tal_t *ctx, const struct pubkey *key) pubkey_to_der(der, key); return tal_hexstr(ctx, der, sizeof(der)); } -REGISTER_TYPE_TO_STRING(pubkey, fmt_pubkey); char *fmt_secp256k1_pubkey(const tal_t *ctx, const secp256k1_pubkey *key) { @@ -81,7 +80,6 @@ char *fmt_secp256k1_pubkey(const tal_t *ctx, const secp256k1_pubkey *key) assert(outlen == sizeof(der)); return tal_hexstr(ctx, der, sizeof(der)); } -REGISTER_TYPE_TO_STRING(secp256k1_pubkey, fmt_secp256k1_pubkey); int pubkey_cmp(const struct pubkey *a, const struct pubkey *b) { diff --git a/bitcoin/shadouble.c b/bitcoin/shadouble.c index bccab4b68..33353d0b6 100644 --- a/bitcoin/shadouble.c +++ b/bitcoin/shadouble.c @@ -1,7 +1,7 @@ #include "config.h" #include #include -#include +#include #include void sha256_double(struct sha256_double *shadouble, const void *p, size_t len) @@ -20,7 +20,6 @@ char *fmt_sha256_double(const tal_t *ctx, const struct sha256_double *shad) { return tal_hexstr(ctx, shad, sizeof(*shad)); } -REGISTER_TYPE_TO_STRING(sha256_double, fmt_sha256_double); void towire_sha256_double(u8 **pptr, const struct sha256_double *sha256d) { diff --git a/bitcoin/short_channel_id.c b/bitcoin/short_channel_id.c index e981263d2..634a3a12c 100644 --- a/bitcoin/short_channel_id.c +++ b/bitcoin/short_channel_id.c @@ -1,7 +1,6 @@ #include "config.h" #include #include -#include #include #include @@ -87,15 +86,6 @@ char *fmt_short_channel_id_dir(const tal_t *ctx, return str; } -static char *fmt_short_channel_id_ptr(const tal_t *ctx, - const struct short_channel_id *scid) -{ - return fmt_short_channel_id(ctx, *scid); -} - -REGISTER_TYPE_TO_STRING(short_channel_id, fmt_short_channel_id_ptr); -REGISTER_TYPE_TO_STRING(short_channel_id_dir, fmt_short_channel_id_dir); - void towire_short_channel_id(u8 **pptr, const struct short_channel_id *short_channel_id) { diff --git a/bitcoin/signature.c b/bitcoin/signature.c index b7495912d..82215cf2c 100644 --- a/bitcoin/signature.c +++ b/bitcoin/signature.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include @@ -334,7 +334,6 @@ char *fmt_secp256k1_ecdsa_signature(const tal_t *ctx, const secp256k1_ecdsa_sign return tal_hexstr(ctx, der, len); } -REGISTER_TYPE_TO_STRING(secp256k1_ecdsa_signature, fmt_secp256k1_ecdsa_signature); char *fmt_bitcoin_signature(const tal_t *ctx, const struct bitcoin_signature *sig) @@ -344,7 +343,6 @@ char *fmt_bitcoin_signature(const tal_t *ctx, return tal_hexstr(ctx, der, len); } -REGISTER_TYPE_TO_STRING(bitcoin_signature, fmt_bitcoin_signature); void fromwire_bitcoin_signature(const u8 **cursor, size_t *max, struct bitcoin_signature *sig) @@ -378,8 +376,6 @@ char *fmt_bip340sig(const tal_t *ctx, const struct bip340sig *bip340sig) return tal_hexstr(ctx, bip340sig->u8, sizeof(bip340sig->u8)); } -REGISTER_TYPE_TO_STRING(bip340sig, fmt_bip340sig); - /* BIP-340: * * This proposal suggests to include the tag by prefixing the hashed diff --git a/bitcoin/tx.c b/bitcoin/tx.c index ba7dab9ca..4245fda3b 100644 --- a/bitcoin/tx.c +++ b/bitcoin/tx.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include @@ -754,10 +754,15 @@ char *fmt_wally_tx(const tal_t *ctx, const struct wally_tx *tx) return s; } -REGISTER_TYPE_TO_STRING(bitcoin_tx, fmt_bitcoin_tx); -REGISTER_TYPE_TO_STRING(bitcoin_txid, fmt_bitcoin_txid); -REGISTER_TYPE_TO_STRING(bitcoin_outpoint, fmt_bitcoin_outpoint); -REGISTER_TYPE_TO_STRING(wally_tx, fmt_wally_tx); +char *fmt_sha256(const tal_t *ctx, const struct sha256 *sha256) +{ + return tal_hexstr(ctx, sha256, sizeof(*sha256)); +} + +char *fmt_ripemd160(const tal_t *ctx, const struct ripemd160 *ripemd160) +{ + return tal_hexstr(ctx, ripemd160, sizeof(*ripemd160)); +} void fromwire_bitcoin_txid(const u8 **cursor, size_t *max, struct bitcoin_txid *txid) diff --git a/bitcoin/tx.h b/bitcoin/tx.h index 84b8d588c..372890c4f 100644 --- a/bitcoin/tx.h +++ b/bitcoin/tx.h @@ -14,7 +14,9 @@ /* BIP 125: Any nsequence < 0xFFFFFFFE is replacable. * And bitcoind uses this value. */ #define BITCOIN_TX_RBF_SEQUENCE 0xFFFFFFFD + struct wally_psbt; +struct ripemd160; struct bitcoin_txid { struct sha256_double shad; @@ -290,6 +292,9 @@ char *fmt_bitcoin_outpoint(const tal_t *ctx, const struct bitcoin_outpoint *outpoint); char *fmt_wally_tx(const tal_t *ctx, const struct wally_tx *tx); +/* For want of somewhere better to define them! */ +char *fmt_sha256(const tal_t *ctx, const struct sha256 *sha256); +char *fmt_ripemd160(const tal_t *ctx, const struct ripemd160 *ripemd160); /* Various weights of transaction parts. */ size_t bitcoin_tx_core_weight(size_t num_inputs, size_t num_outputs); diff --git a/channeld/Makefile b/channeld/Makefile index d6aff5630..255743737 100644 --- a/channeld/Makefile +++ b/channeld/Makefile @@ -90,7 +90,6 @@ CHANNELD_COMMON_OBJS := \ common/status_wire.o \ common/subdaemon.o \ common/timeout.o \ - common/type_to_string.o \ common/utils.o \ common/utxo.o \ common/version.o \ diff --git a/channeld/channeld.c b/channeld/channeld.c index 756039cd0..a2a49524a 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -42,7 +42,6 @@ #include #include #include -#include #include #include #include diff --git a/channeld/full_channel.c b/channeld/full_channel.c index 940e62413..04a7482e0 100644 --- a/channeld/full_channel.c +++ b/channeld/full_channel.c @@ -13,7 +13,6 @@ #include #include #include -#include #include /* Needs to be at end, since it doesn't include its own hdrs */ #include "full_channel_error_names_gen.h" diff --git a/channeld/test/Makefile b/channeld/test/Makefile index fb402a7e6..67bc5a797 100644 --- a/channeld/test/Makefile +++ b/channeld/test/Makefile @@ -22,7 +22,6 @@ CHANNELD_TEST_COMMON_OBJS := \ common/permute_tx.o \ common/pseudorand.o \ common/setup.o \ - common/type_to_string.o \ common/utils.o $(CHANNELD_TEST_PROGRAMS): $(BITCOIN_OBJS) $(WIRE_OBJS) $(CHANNELD_TEST_COMMON_OBJS) diff --git a/channeld/test/run-commit_tx.c b/channeld/test/run-commit_tx.c index 5fae1a293..27fb5088c 100644 --- a/channeld/test/run-commit_tx.c +++ b/channeld/test/run-commit_tx.c @@ -1,7 +1,8 @@ #include "config.h" #include #include -#include +#include + static bool print_superverbose; #define SUPERVERBOSE(...) \ do { if (print_superverbose) printf(__VA_ARGS__); } while(0) diff --git a/channeld/watchtower.c b/channeld/watchtower.c index 40eb7a9c3..43a267e84 100644 --- a/channeld/watchtower.c +++ b/channeld/watchtower.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include diff --git a/cli/test/Makefile b/cli/test/Makefile index d06cfe247..6f9c9bea6 100644 --- a/cli/test/Makefile +++ b/cli/test/Makefile @@ -20,7 +20,6 @@ CLI_TEST_COMMON_OBJS := \ common/setup.o \ common/utils.o \ common/version.o \ - common/type_to_string.o \ common/permute_tx.o $(CLI_TEST_PROGRAMS): libccan.a $(BITCOIN_OBJS) $(WIRE_OBJS) $(CLI_TEST_COMMON_OBJS) diff --git a/closingd/Makefile b/closingd/Makefile index a238ef6f0..11ef95496 100644 --- a/closingd/Makefile +++ b/closingd/Makefile @@ -53,7 +53,6 @@ CLOSINGD_COMMON_OBJS := \ common/status.o \ common/status_wire.o \ common/subdaemon.o \ - common/type_to_string.o \ common/utils.o \ common/utxo.o \ common/version.o \ diff --git a/closingd/closingd.c b/closingd/closingd.c index dc4adae8d..acbb12fd7 100644 --- a/closingd/closingd.c +++ b/closingd/closingd.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include diff --git a/common/Makefile b/common/Makefile index 37529c6fc..4c8c946f6 100644 --- a/common/Makefile +++ b/common/Makefile @@ -94,7 +94,6 @@ COMMON_SRC_NOGEN := \ common/timeout.c \ common/trace.c \ common/tx_roles.c \ - common/type_to_string.c \ common/utils.c \ common/utxo.c \ common/version.c \ diff --git a/common/amount.c b/common/amount.c index 9d2dd3b76..965f23384 100644 --- a/common/amount.c +++ b/common/amount.c @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include @@ -64,13 +64,6 @@ char *fmt_amount_msat(const tal_t *ctx, struct amount_msat msat) return tal_fmt(ctx, "%"PRIu64"msat", msat.millisatoshis); } -static const char *fmt_amount_msat_ptr(const tal_t *ctx, - const struct amount_msat *msat) -{ - return fmt_amount_msat(ctx, *msat); -} -REGISTER_TYPE_TO_STRING(amount_msat, fmt_amount_msat_ptr); - const char *fmt_amount_sat_btc(const tal_t *ctx, struct amount_sat sat, bool append_unit) @@ -89,13 +82,6 @@ char *fmt_amount_sat(const tal_t *ctx, struct amount_sat sat) return tal_fmt(ctx, "%"PRIu64"sat", sat.satoshis); } -static const char *fmt_amount_sat_ptr(const tal_t *ctx, - const struct amount_sat *sat) -{ - return fmt_amount_sat(ctx, *sat); -} -REGISTER_TYPE_TO_STRING(amount_sat, fmt_amount_sat_ptr); - static bool breakup(const char *str, size_t slen, /* Length of first numeric part. */ size_t *whole_number_len, diff --git a/common/blindedpath.c b/common/blindedpath.c index f30eabc2b..6f2c58521 100644 --- a/common/blindedpath.c +++ b/common/blindedpath.c @@ -1,4 +1,5 @@ #include "config.h" +#include #include #include #include diff --git a/common/blockheight_states.c b/common/blockheight_states.c index f6187d226..5066f08ad 100644 --- a/common/blockheight_states.c +++ b/common/blockheight_states.c @@ -4,7 +4,6 @@ #include #include #include -#include #include struct height_states *new_height_states(const tal_t *ctx, @@ -160,4 +159,3 @@ char *fmt_height_states(const tal_t *ctx, tal_append_fmt(&ret, " }"); return ret; } -REGISTER_TYPE_TO_STRING(height_states, fmt_height_states); diff --git a/common/bolt12_merkle.c b/common/bolt12_merkle.c index 8a817e182..39939fd0c 100644 --- a/common/bolt12_merkle.c +++ b/common/bolt12_merkle.c @@ -1,5 +1,6 @@ #include "config.h" #include +#include #include #include #include diff --git a/common/channel_id.c b/common/channel_id.c index 317a04fe2..cd1bdd031 100644 --- a/common/channel_id.c +++ b/common/channel_id.c @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include void derive_channel_id(struct channel_id *channel_id, @@ -98,5 +98,3 @@ char *fmt_channel_id(const tal_t *ctx, const struct channel_id *channel_id) { return tal_hexstr(ctx, channel_id, sizeof(*channel_id)); } - -REGISTER_TYPE_TO_STRING(channel_id, fmt_channel_id); diff --git a/common/coin_mvt.c b/common/coin_mvt.c index 7a571aaea..504f3b9fb 100644 --- a/common/coin_mvt.c +++ b/common/coin_mvt.c @@ -5,7 +5,6 @@ #include #include #include -#include #include #define EXTERNAL "external" diff --git a/common/fee_states.c b/common/fee_states.c index 87940f118..b63c34e51 100644 --- a/common/fee_states.c +++ b/common/fee_states.c @@ -3,7 +3,6 @@ #include #include #include -#include #include /* If we're the finder, it's like an HTLC we added, if they are, it's like @@ -170,4 +169,3 @@ char *fmt_fee_states(const tal_t *ctx, tal_append_fmt(&ret, " }"); return ret; } -REGISTER_TYPE_TO_STRING(fee_states, fmt_fee_states); diff --git a/common/gossmap.c b/common/gossmap.c index 8a420c31e..31a5a4d0f 100644 --- a/common/gossmap.c +++ b/common/gossmap.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include diff --git a/common/initial_channel.c b/common/initial_channel.c index d08d36738..bb626308e 100644 --- a/common/initial_channel.c +++ b/common/initial_channel.c @@ -8,7 +8,6 @@ #include #include #include -#include struct channel *new_initial_channel(const tal_t *ctx, const struct channel_id *cid, @@ -247,5 +246,3 @@ char *fmt_channel(const tal_t *ctx, const struct channel *channel) fmt_channel_view(ctx, &channel->view[LOCAL]), fmt_channel_view(ctx, &channel->view[REMOTE])); } -/* Magic comment. */ -REGISTER_TYPE_TO_STRING(channel, fmt_channel); diff --git a/common/initial_commit_tx.c b/common/initial_commit_tx.c index c7f7e52ff..07e3c8909 100644 --- a/common/initial_commit_tx.c +++ b/common/initial_commit_tx.c @@ -5,7 +5,6 @@ #include #include #include -#include /* BOLT #3: * diff --git a/common/interactivetx.c b/common/interactivetx.c index 1950bcb35..cbb19e415 100644 --- a/common/interactivetx.c +++ b/common/interactivetx.c @@ -21,7 +21,6 @@ #include #include #include -#include #include /* diff --git a/common/json_stream.c b/common/json_stream.c index 3b1743c3e..aa2c0dce2 100644 --- a/common/json_stream.c +++ b/common/json_stream.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include diff --git a/common/node_id.c b/common/node_id.c index 273e8053f..4998323e2 100644 --- a/common/node_id.c +++ b/common/node_id.c @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include /* Convert from pubkey to compressed pubkey. */ @@ -38,7 +38,6 @@ char *fmt_node_id(const tal_t *ctx, const struct node_id *id) { return tal_hexstr(ctx, id->k, sizeof(id->k)); } -REGISTER_TYPE_TO_STRING(node_id, fmt_node_id); /* Convert from hex string of SEC1 encoding */ bool node_id_from_hexstr(const char *str, size_t slen, struct node_id *id) diff --git a/common/onion_message_parse.c b/common/onion_message_parse.c index 0530eada5..cb314fb40 100644 --- a/common/onion_message_parse.c +++ b/common/onion_message_parse.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include diff --git a/common/test/Makefile b/common/test/Makefile index 8c465bfb2..720ce84e5 100644 --- a/common/test/Makefile +++ b/common/test/Makefile @@ -31,7 +31,6 @@ common/test/run-json: \ common/lease_rates.o \ common/node_id.o \ common/pseudorand.o \ - common/type_to_string.o \ common/wireaddr.o \ wire/fromwire.o \ wire/onion_wiregen.o \ @@ -74,7 +73,6 @@ common/test/run-bolt12_merkle: \ common/bech32_util.o \ common/bolt12.o \ common/node_id.o \ - common/type_to_string.o \ common/wireaddr.o \ wire/bolt12_wiregen.o \ wire/fromwire.o \ diff --git a/common/test/run-blindedpath_enctlv.c b/common/test/run-blindedpath_enctlv.c index d779f6fb1..0fdee4d9e 100644 --- a/common/test/run-blindedpath_enctlv.c +++ b/common/test/run-blindedpath_enctlv.c @@ -2,7 +2,6 @@ #include "../bigsize.c" #include "../blinding.c" #include "../hmac.c" -#include "../type_to_string.c" #include #include #include diff --git a/common/test/run-blindedpath_onion.c b/common/test/run-blindedpath_onion.c index b94ccc51a..0a2381059 100644 --- a/common/test/run-blindedpath_onion.c +++ b/common/test/run-blindedpath_onion.c @@ -7,7 +7,6 @@ #include "../onion_decode.c" #include "../onion_encode.c" #include "../sphinx.c" -#include "../type_to_string.c" #include #include #include diff --git a/common/test/run-bolt12_merkle.c b/common/test/run-bolt12_merkle.c index edeb52cd1..b5065b787 100644 --- a/common/test/run-bolt12_merkle.c +++ b/common/test/run-bolt12_merkle.c @@ -1,7 +1,6 @@ #define SUPERVERBOSE printf #include "config.h" /* Needed before including bolt12_merkle.c: */ - #include #include #include "../bolt12_merkle.c" #include diff --git a/common/test/run-gossmap-fp16.c b/common/test/run-gossmap-fp16.c index fe4178fa5..274eccf3a 100644 --- a/common/test/run-gossmap-fp16.c +++ b/common/test/run-gossmap-fp16.c @@ -1,7 +1,6 @@ #include "config.h" #include "../fp16.c" #include -#include #include #include diff --git a/common/test/run-key_derive.c b/common/test/run-key_derive.c index 360b2de68..f30fcdfb2 100644 --- a/common/test/run-key_derive.c +++ b/common/test/run-key_derive.c @@ -1,12 +1,12 @@ #define SUPERVERBOSE #include "config.h" +#include #include #include #include #include #include -#include "../type_to_string.c" #include "../key_derive.c" /* AUTOGENERATED MOCKS START */ diff --git a/common/test/run-onion-message-test.c b/common/test/run-onion-message-test.c index 2314bd582..f7bfd66bf 100644 --- a/common/test/run-onion-message-test.c +++ b/common/test/run-onion-message-test.c @@ -15,7 +15,6 @@ static void maybe_print(const char *fmt, ...); #include "../onion_encode.c" #include "../onion_message_parse.c" #include "../sphinx.c" -#include "../type_to_string.c" #include "../../wire/onion_wiregen.c" #include "../../wire/peer_wiregen.c" #include diff --git a/common/test/run-onion-test-vector.c b/common/test/run-onion-test-vector.c index aefd35c0a..84eea064b 100644 --- a/common/test/run-onion-test-vector.c +++ b/common/test/run-onion-test-vector.c @@ -5,7 +5,6 @@ #include "../onion_decode.c" #include "../sphinx.c" #include "../hmac.c" -#include "../type_to_string.c" #include "../../wire/towire.c" #include "../../wire/fromwire.c" #include "../../wire/onion_wiregen.c" diff --git a/common/test/run-route-infloop.c b/common/test/run-route-infloop.c index 6a29651fb..601f8af13 100644 --- a/common/test/run-route-infloop.c +++ b/common/test/run-route-infloop.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include diff --git a/common/test/run-route-specific.c b/common/test/run-route-specific.c index da067cc40..4ab0f4248 100644 --- a/common/test/run-route-specific.c +++ b/common/test/run-route-specific.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include diff --git a/common/test/run-route.c b/common/test/run-route.c index b5d648dbd..f3479098f 100644 --- a/common/test/run-route.c +++ b/common/test/run-route.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include diff --git a/common/test/run-route_blinding_onion_test.c b/common/test/run-route_blinding_onion_test.c index 8983b3f43..ea7077422 100644 --- a/common/test/run-route_blinding_onion_test.c +++ b/common/test/run-route_blinding_onion_test.c @@ -13,7 +13,6 @@ #include "../json_parse_simple.c" #include "../onion_encode.c" #include "../sphinx.c" -#include "../type_to_string.c" #include "../../wire/onion_wiregen.c" #include #include diff --git a/common/test/run-route_blinding_test.c b/common/test/run-route_blinding_test.c index eaa4afb69..49f8dc7f6 100644 --- a/common/test/run-route_blinding_test.c +++ b/common/test/run-route_blinding_test.c @@ -7,7 +7,6 @@ #include "../hmac.c" #include "../json_parse.c" #include "../json_parse_simple.c" -#include "../type_to_string.c" #include #include #include diff --git a/common/type_to_string.c b/common/type_to_string.c deleted file mode 100644 index ec19f822a..000000000 --- a/common/type_to_string.c +++ /dev/null @@ -1,49 +0,0 @@ -#include "config.h" -#include -#include -#include -#include - -char *fmt_sha256(const tal_t *ctx, const struct sha256 *sha256) -{ - return tal_hexstr(ctx, sha256, sizeof(*sha256)); -} - -char *fmt_ripemd160(const tal_t *ctx, const struct ripemd160 *ripemd160) -{ - return tal_hexstr(ctx, ripemd160, sizeof(*ripemd160)); -} - -/* We need at least one, and these are in CCAN so register it here. */ -REGISTER_TYPE_TO_STRING(sha256, fmt_sha256); -REGISTER_TYPE_TO_STRING(ripemd160, fmt_ripemd160); - -const char *type_to_string_(const tal_t *ctx, const char *typename, - union printable_types u) -{ - const char *s = NULL; - size_t i; - static size_t num_p; - static struct type_to_string **t = NULL; - - assert(typename != NULL); - - if (!t) - t = autodata_get(type_to_string, &num_p); - - /* Typenames in registrations don't include "struct " */ - if (strstarts(typename, "struct ")) - typename += strlen("struct "); - - for (i = 0; i < num_p; i++) { - if (streq(t[i]->typename, typename)) { - s = t[i]->fmt(ctx, u); - break; - } - } - /* **BROKEN** makes CI upset, which is what we want! */ - if (!s) - s = tal_fmt(ctx, "**BROKEN** UNKNOWN TYPE %s", typename); - - return s; -} diff --git a/common/type_to_string.h b/common/type_to_string.h deleted file mode 100644 index 45fae3725..000000000 --- a/common/type_to_string.h +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef LIGHTNING_COMMON_TYPE_TO_STRING_H -#define LIGHTNING_COMMON_TYPE_TO_STRING_H -#include "config.h" -#include -#include - -/* This must match the type_to_string_ cases. */ -union printable_types { - const struct pubkey *pubkey; - const struct node_id *node_id; - const struct bitcoin_txid *bitcoin_txid; - const struct bitcoin_blkid *bitcoin_blkid; - const struct bitcoin_outpoint *bitcoin_outpoint; - const struct sha256 *sha256; - const struct sha256_double *sha256_double; - const struct ripemd160 *ripemd160; - const struct bitcoin_tx *bitcoin_tx; - const struct htlc *htlc; - const struct preimage *preimage; - const struct channel_oneside *channel_oneside; - const struct wireaddr *wireaddr; - const struct wireaddr_internal *wireaddr_internal; - const secp256k1_pubkey *secp256k1_pubkey; - const struct channel_id *channel_id; - const struct short_channel_id *short_channel_id; - const struct short_channel_id_dir *short_channel_id_dir; - const struct secret *secret; - const struct privkey *privkey; - const secp256k1_ecdsa_signature *secp256k1_ecdsa_signature; - const struct bitcoin_signature *bitcoin_signature; - const struct bip340sig *bip340sig; - const struct channel *channel; - const struct amount_msat *amount_msat; - const struct amount_sat *amount_sat; - const struct fee_states *fee_states; - const struct height_states *height_states; - const char *charp_; - const struct wally_psbt *wally_psbt; - const struct wally_tx *wally_tx; -}; - -#define type_to_string(ctx, type, ptr) \ - type_to_string_((ctx), stringify(type), \ - ((void)sizeof((ptr) == (type *)NULL), \ - ((union printable_types)((const type *)ptr)))) - -const char *type_to_string_(const tal_t *ctx, const char *typename, - union printable_types u); - -#define REGISTER_TYPE_TO_STRING(typename, fmtfn) \ - static const char *fmt_##typename##_(const tal_t *ctx, \ - union printable_types u) \ - { \ - return fmtfn(ctx, u.typename); \ - } \ - static struct type_to_string ttos_##typename = { \ - #typename, fmt_##typename##_ \ - }; \ - AUTODATA(type_to_string, &ttos_##typename) - -struct type_to_string { - const char *typename; - const char *(*fmt)(const tal_t *ctx, union printable_types u); -}; -AUTODATA_TYPE(type_to_string, struct type_to_string); - -char *fmt_sha256(const tal_t *ctx, const struct sha256 *sha256); -char *fmt_ripemd160(const tal_t *ctx, const struct ripemd160 *ripemd160); - -#endif /* LIGHTNING_COMMON_TYPE_TO_STRING_H */ diff --git a/common/wire_error.c b/common/wire_error.c index fc38abf06..97e121ee7 100644 --- a/common/wire_error.c +++ b/common/wire_error.c @@ -1,7 +1,6 @@ #include "config.h" #include #include -#include #include #include diff --git a/common/wireaddr.c b/common/wireaddr.c index e9781f8ae..508a0eccb 100644 --- a/common/wireaddr.c +++ b/common/wireaddr.c @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include #include @@ -243,7 +243,6 @@ char *fmt_wireaddr_internal(const tal_t *ctx, } abort(); } -REGISTER_TYPE_TO_STRING(wireaddr_internal, fmt_wireaddr_internal); char *fmt_wireaddr_without_port(const tal_t * ctx, const struct wireaddr *a) { @@ -279,7 +278,6 @@ char *fmt_wireaddr(const tal_t *ctx, const struct wireaddr *a) tal_append_fmt(&ret, ":%u", a->port); return ret; } -REGISTER_TYPE_TO_STRING(wireaddr, fmt_wireaddr); /* Valid forms: * diff --git a/connectd/Makefile b/connectd/Makefile index bbb1ab9ed..056cde6b9 100644 --- a/connectd/Makefile +++ b/connectd/Makefile @@ -74,7 +74,6 @@ CONNECTD_COMMON_OBJS := \ common/status_wire.o \ common/subdaemon.o \ common/timeout.o \ - common/type_to_string.o \ common/utils.o \ common/utxo.o \ common/version.o \ diff --git a/connectd/connectd.c b/connectd/connectd.c index a169b2b7b..3224efdf6 100644 --- a/connectd/connectd.c +++ b/connectd/connectd.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include diff --git a/connectd/handshake.c b/connectd/handshake.c index ed92da71e..0f0a4dcd5 100644 --- a/connectd/handshake.c +++ b/connectd/handshake.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include diff --git a/connectd/multiplex.c b/connectd/multiplex.c index 72b160353..b72df46f5 100644 --- a/connectd/multiplex.c +++ b/connectd/multiplex.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include diff --git a/connectd/onion_message.c b/connectd/onion_message.c index c71129f47..6feba7998 100644 --- a/connectd/onion_message.c +++ b/connectd/onion_message.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include diff --git a/connectd/test/Makefile b/connectd/test/Makefile index 4ac2df0d4..c624f3219 100644 --- a/connectd/test/Makefile +++ b/connectd/test/Makefile @@ -9,7 +9,6 @@ CONNECTD_TEST_COMMON_OBJS := \ common/features.o \ common/pseudorand.o \ common/setup.o \ - common/type_to_string.o \ common/utils.o ALL_C_SOURCES += $(CONNECTD_TEST_SRC) diff --git a/devtools/Makefile b/devtools/Makefile index dc1a22b24..d9aa1d04f 100644 --- a/devtools/Makefile +++ b/devtools/Makefile @@ -38,7 +38,6 @@ DEVTOOLS_COMMON_OBJS := \ common/psbt_open.o \ common/pseudorand.o \ common/setup.o \ - common/type_to_string.o \ common/utils.o \ common/version.o \ common/wireaddr.o \ diff --git a/devtools/bolt11-cli.c b/devtools/bolt11-cli.c index 76aa0f8de..ee919b0d3 100644 --- a/devtools/bolt11-cli.c +++ b/devtools/bolt11-cli.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include diff --git a/devtools/bolt12-cli.c b/devtools/bolt12-cli.c index 145e678b8..b21d75525 100644 --- a/devtools/bolt12-cli.c +++ b/devtools/bolt12-cli.c @@ -1,5 +1,6 @@ #include "config.h" #include +#include #include #include #include @@ -10,7 +11,6 @@ #include #include #include -#include #include #include #include diff --git a/devtools/dump-gossipstore.c b/devtools/dump-gossipstore.c index f91296841..159981666 100644 --- a/devtools/dump-gossipstore.c +++ b/devtools/dump-gossipstore.c @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include diff --git a/devtools/fp16.c b/devtools/fp16.c index 4f541e863..abf1947ed 100644 --- a/devtools/fp16.c +++ b/devtools/fp16.c @@ -4,7 +4,6 @@ #include #include #include -#include #include #include diff --git a/devtools/mkclose.c b/devtools/mkclose.c index b8796ca78..de51c7f64 100644 --- a/devtools/mkclose.c +++ b/devtools/mkclose.c @@ -11,7 +11,6 @@ #include #include #include -#include #include static bool verbose = false; diff --git a/devtools/mkcommit.c b/devtools/mkcommit.c index e4b1db6e9..512e7f3c2 100644 --- a/devtools/mkcommit.c +++ b/devtools/mkcommit.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include diff --git a/devtools/mkfunding.c b/devtools/mkfunding.c index f35e70953..2bd7cb24f 100644 --- a/devtools/mkfunding.c +++ b/devtools/mkfunding.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include diff --git a/devtools/mkgossip.c b/devtools/mkgossip.c index 36dbf8a01..63a92467d 100644 --- a/devtools/mkgossip.c +++ b/devtools/mkgossip.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include diff --git a/devtools/print_wire.c b/devtools/print_wire.c index a7697d272..04b0b9a7e 100644 --- a/devtools/print_wire.c +++ b/devtools/print_wire.c @@ -2,7 +2,6 @@ #include #include #include -#include #include #include #include diff --git a/devtools/route.c b/devtools/route.c index 88e6a8c0e..8fe64a4d7 100644 --- a/devtools/route.c +++ b/devtools/route.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include diff --git a/devtools/topology.c b/devtools/topology.c index e1f73f0b5..ccb86d3c1 100644 --- a/devtools/topology.c +++ b/devtools/topology.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include diff --git a/doc/contribute-to-core-lightning/coding-style-guidelines.md b/doc/contribute-to-core-lightning/coding-style-guidelines.md index a4a3ab752..a8082be85 100644 --- a/doc/contribute-to-core-lightning/coding-style-guidelines.md +++ b/doc/contribute-to-core-lightning/coding-style-guidelines.md @@ -104,8 +104,7 @@ Everything should be declared static and const by default. Note that `tal_free( ## Typesafety Is Worth Some Pain -If code is typesafe, refactoring is as simple as changing a type and compiling to find where to refactor. We rely on this, so most places in the code will break if you hand the wrong type, eg -`type_to_string` and `structeq`. +If code is typesafe, refactoring is as simple as changing a type and compiling to find where to refactor. We rely on this, so most places in the code will break if you hand the wrong type, eg `structeq` and `tal`. The two tools we have to help us are complicated macros in `ccan/typesafe_cb` allow you to create callbacks which must match the type of their argument, rather than using `void *`. The other is `ARRAY_SIZE`, a macro which won't compile if you hand it a pointer instead of an actual array. @@ -170,4 +169,4 @@ In case you think the pull request is small enough not to require a changelog en Under some circumstances a feature may be removed even without deprecation warning if it was not part of a released version yet, or the removal is urgent. -In order to ensure that each pull request has the required `Changelog-*:` line for the changelog our trusty @bitcoin-bot will check logs whenever a pull request is created or updated and search for the required line. If there is no such line it'll mark the pull request as `pending` to call out the need for an entry. \ No newline at end of file +In order to ensure that each pull request has the required `Changelog-*:` line for the changelog our trusty @bitcoin-bot will check logs whenever a pull request is created or updated and search for the required line. If there is no such line it'll mark the pull request as `pending` to call out the need for an entry. diff --git a/gossipd/Makefile b/gossipd/Makefile index 9498fa48c..b5b3d308a 100644 --- a/gossipd/Makefile +++ b/gossipd/Makefile @@ -63,7 +63,6 @@ GOSSIPD_COMMON_OBJS := \ common/status_wire.o \ common/subdaemon.o \ common/timeout.o \ - common/type_to_string.o \ common/utils.o \ common/utxo.o \ common/version.o \ diff --git a/gossipd/gossipd.c b/gossipd/gossipd.c index a248298d5..08989fcef 100644 --- a/gossipd/gossipd.c +++ b/gossipd/gossipd.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include diff --git a/gossipd/gossmap_manage.c b/gossipd/gossmap_manage.c index 3ebc35697..f410912a6 100644 --- a/gossipd/gossmap_manage.c +++ b/gossipd/gossmap_manage.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include diff --git a/gossipd/queries.c b/gossipd/queries.c index 391047a46..6c8ce1215 100644 --- a/gossipd/queries.c +++ b/gossipd/queries.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include diff --git a/gossipd/sigcheck.c b/gossipd/sigcheck.c index db503537b..8897586a0 100644 --- a/gossipd/sigcheck.c +++ b/gossipd/sigcheck.c @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include diff --git a/gossipd/test/Makefile b/gossipd/test/Makefile index 4f6c15485..99cb7faaf 100644 --- a/gossipd/test/Makefile +++ b/gossipd/test/Makefile @@ -20,7 +20,6 @@ GOSSIPD_TEST_COMMON_OBJS := \ common/lease_rates.o \ common/pseudorand.o \ common/setup.o \ - common/type_to_string.o \ common/utils.o \ common/wireaddr.o \ gossipd/gossip_store_wiregen.o \ diff --git a/hsmd/Makefile b/hsmd/Makefile index c50c7a4e0..e7f626038 100644 --- a/hsmd/Makefile +++ b/hsmd/Makefile @@ -48,7 +48,6 @@ HSMD_COMMON_OBJS := \ common/status_wire.o \ common/status_wiregen.o \ common/subdaemon.o \ - common/type_to_string.o \ common/utils.o \ common/utxo.o \ common/version.o \ diff --git a/hsmd/hsmd.c b/hsmd/hsmd.c index 9a8dad10c..e41033c19 100644 --- a/hsmd/hsmd.c +++ b/hsmd/hsmd.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include /*~ _wiregen files are autogenerated by tools/generate-wire.py */ diff --git a/hsmd/libhsmd.c b/hsmd/libhsmd.c index f6fc745cd..0c8f91ede 100644 --- a/hsmd/libhsmd.c +++ b/hsmd/libhsmd.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include diff --git a/lightningd/Makefile b/lightningd/Makefile index ea61d6ffa..d7243855f 100644 --- a/lightningd/Makefile +++ b/lightningd/Makefile @@ -142,7 +142,6 @@ LIGHTNINGD_COMMON_OBJS := \ common/timeout.o \ common/trace.o \ common/tx_roles.o \ - common/type_to_string.o \ common/utils.o \ common/utxo.o \ common/version.o \ diff --git a/lightningd/anchorspend.c b/lightningd/anchorspend.c index ffb833215..aa2ef9c9b 100644 --- a/lightningd/anchorspend.c +++ b/lightningd/anchorspend.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include diff --git a/lightningd/chaintopology.c b/lightningd/chaintopology.c index 2040582da..1ac6f2fcf 100644 --- a/lightningd/chaintopology.c +++ b/lightningd/chaintopology.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include diff --git a/lightningd/channel.c b/lightningd/channel.c index 5c37cbb6c..eeeb08789 100644 --- a/lightningd/channel.c +++ b/lightningd/channel.c @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include diff --git a/lightningd/channel_control.c b/lightningd/channel_control.c index 1596d2b82..088a18329 100644 --- a/lightningd/channel_control.c +++ b/lightningd/channel_control.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include diff --git a/lightningd/channel_gossip.c b/lightningd/channel_gossip.c index 9636f3da3..36d47b29d 100644 --- a/lightningd/channel_gossip.c +++ b/lightningd/channel_gossip.c @@ -2,7 +2,6 @@ #include #include #include -#include #include #include #include diff --git a/lightningd/closing_control.c b/lightningd/closing_control.c index 5c0412188..11a946957 100644 --- a/lightningd/closing_control.c +++ b/lightningd/closing_control.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include diff --git a/lightningd/coin_mvts.c b/lightningd/coin_mvts.c index b97c939db..68bdde72a 100644 --- a/lightningd/coin_mvts.c +++ b/lightningd/coin_mvts.c @@ -1,6 +1,5 @@ #include "config.h" #include -#include #include #include #include diff --git a/lightningd/connect_control.c b/lightningd/connect_control.c index 68594b3a4..88688c1eb 100644 --- a/lightningd/connect_control.c +++ b/lightningd/connect_control.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include diff --git a/lightningd/dual_open_control.c b/lightningd/dual_open_control.c index 2c66cb7be..3a595f32f 100644 --- a/lightningd/dual_open_control.c +++ b/lightningd/dual_open_control.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include diff --git a/lightningd/gossip_control.c b/lightningd/gossip_control.c index 984cb8273..932ca8b47 100644 --- a/lightningd/gossip_control.c +++ b/lightningd/gossip_control.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include diff --git a/lightningd/hsm_control.c b/lightningd/hsm_control.c index 58ea8dfe2..f53efbbf2 100644 --- a/lightningd/hsm_control.c +++ b/lightningd/hsm_control.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include diff --git a/lightningd/htlc_end.c b/lightningd/htlc_end.c index d47dcbf8d..0c97965f7 100644 --- a/lightningd/htlc_end.c +++ b/lightningd/htlc_end.c @@ -4,7 +4,6 @@ #include #include #include -#include #include #include diff --git a/lightningd/htlc_set.c b/lightningd/htlc_set.c index abbf3af70..b259a256e 100644 --- a/lightningd/htlc_set.c +++ b/lightningd/htlc_set.c @@ -1,7 +1,6 @@ #include "config.h" #include #include -#include #include #include #include diff --git a/lightningd/invoice.c b/lightningd/invoice.c index aabd146bf..1364b8e10 100644 --- a/lightningd/invoice.c +++ b/lightningd/invoice.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include diff --git a/lightningd/lightningd.c b/lightningd/lightningd.c index 161515284..95b5807c8 100644 --- a/lightningd/lightningd.c +++ b/lightningd/lightningd.c @@ -56,7 +56,6 @@ #include #include #include -#include #include #include @@ -1355,12 +1354,13 @@ int main(int argc, char *argv[]) /*~ Mark ourselves live. * - * Note the use of type_to_string() here: it's a typesafe formatter, - * often handed 'tmpctx' like here to allocate a throwaway string for - * formatting. json_escape() avoids printing weird characters in our - * log. And tal_hex() is a helper from utils which returns a hex string; - * it's assumed that the argument was allocated with tal or tal_arr - * so it can use tal_bytelen() to get the length. */ + * Note the use of fmt_node_id() here: most complex types have a + * string formatter of this convention, usually handed 'tmpctx' like + * here to allocate a throwaway string for formatting. json_escape() + * avoids printing weird characters in our log. And tal_hex() is a + * helper from utils which returns a hex string; it's assumed that the + * argument was allocated with tal or tal_arr so it can use + * tal_bytelen() to get the length. */ log_info(ld->log, "--------------------------------------------------"); log_info(ld->log, "Server started with public key %s, alias %s (color #%s) and lightningd %s", fmt_node_id(tmpctx, &ld->id), diff --git a/lightningd/notification.c b/lightningd/notification.c index 78ba847bd..c08240339 100644 --- a/lightningd/notification.c +++ b/lightningd/notification.c @@ -1,7 +1,6 @@ #include "config.h" #include #include -#include #include #include #include diff --git a/lightningd/offer.c b/lightningd/offer.c index 741097095..a62ad418a 100644 --- a/lightningd/offer.c +++ b/lightningd/offer.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include diff --git a/lightningd/onchain_control.c b/lightningd/onchain_control.c index 46ae3f224..681ba2334 100644 --- a/lightningd/onchain_control.c +++ b/lightningd/onchain_control.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include diff --git a/lightningd/onion_message.c b/lightningd/onion_message.c index a2ff80517..1362d5850 100644 --- a/lightningd/onion_message.c +++ b/lightningd/onion_message.c @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include diff --git a/lightningd/opening_common.c b/lightningd/opening_common.c index d9a4d92ba..b9019659d 100644 --- a/lightningd/opening_common.c +++ b/lightningd/opening_common.c @@ -1,7 +1,6 @@ #include "config.h" #include #include -#include #include #include #include diff --git a/lightningd/opening_control.c b/lightningd/opening_control.c index 0f7c3dcce..b2279f92e 100644 --- a/lightningd/opening_control.c +++ b/lightningd/opening_control.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include diff --git a/lightningd/options.c b/lightningd/options.c index ca683538f..af13bc716 100644 --- a/lightningd/options.c +++ b/lightningd/options.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include diff --git a/lightningd/pay.c b/lightningd/pay.c index 76edc5dc3..201d9cffc 100644 --- a/lightningd/pay.c +++ b/lightningd/pay.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index b6743db8e..6128a9848 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include diff --git a/lightningd/peer_htlcs.c b/lightningd/peer_htlcs.c index 575db466a..43b0b18b1 100644 --- a/lightningd/peer_htlcs.c +++ b/lightningd/peer_htlcs.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include diff --git a/lightningd/routehint.c b/lightningd/routehint.c index 546f2147c..900480765 100644 --- a/lightningd/routehint.c +++ b/lightningd/routehint.c @@ -1,7 +1,6 @@ #include "config.h" #include #include -#include #include #include #include diff --git a/lightningd/runes.c b/lightningd/runes.c index ee5544019..0ee475b5e 100644 --- a/lightningd/runes.c +++ b/lightningd/runes.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include diff --git a/lightningd/test/Makefile b/lightningd/test/Makefile index b2fc99230..690ac37b8 100644 --- a/lightningd/test/Makefile +++ b/lightningd/test/Makefile @@ -25,7 +25,6 @@ LIGHTNINGD_TEST_COMMON_OBJS := \ common/setup.o \ common/utils.o \ common/utxo.o \ - common/type_to_string.o \ common/permute_tx.o \ common/wireaddr.o \ diff --git a/lightningd/watch.c b/lightningd/watch.c index baa9c25b6..5cf9ffcb8 100644 --- a/lightningd/watch.c +++ b/lightningd/watch.c @@ -30,7 +30,6 @@ * WE ASSUME NO MALLEABILITY! This requires segregated witness. */ #include "config.h" -#include #include #include #include diff --git a/onchaind/Makefile b/onchaind/Makefile index e875af751..8ef57d9ba 100644 --- a/onchaind/Makefile +++ b/onchaind/Makefile @@ -60,7 +60,6 @@ ONCHAIND_COMMON_OBJS := \ common/status.o \ common/status_wire.o \ common/subdaemon.o \ - common/type_to_string.o \ common/utils.o \ common/utxo.o \ common/version.o \ diff --git a/onchaind/onchaind.c b/onchaind/onchaind.c index f480131cf..aba775391 100644 --- a/onchaind/onchaind.c +++ b/onchaind/onchaind.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include diff --git a/onchaind/test/Makefile b/onchaind/test/Makefile index 2bb2269e0..6777cb139 100644 --- a/onchaind/test/Makefile +++ b/onchaind/test/Makefile @@ -16,7 +16,6 @@ ONCHAIND_TEST_COMMON_OBJS := \ common/psbt_keypath.o \ common/pseudorand.o \ common/setup.o \ - common/type_to_string.o \ common/utils.o $(ONCHAIND_TEST_PROGRAMS): $(ONCHAIND_TEST_COMMON_OBJS) $(BITCOIN_OBJS) diff --git a/openingd/Makefile b/openingd/Makefile index 100525c2e..135adb346 100644 --- a/openingd/Makefile +++ b/openingd/Makefile @@ -78,7 +78,6 @@ OPENINGD_COMMON_OBJS := \ common/status_wiregen.o \ common/subdaemon.o \ common/tx_roles.o \ - common/type_to_string.o \ common/utils.o \ common/utxo.o \ common/version.o \ diff --git a/openingd/common.c b/openingd/common.c index 4bf33270a..50fe46f35 100644 --- a/openingd/common.c +++ b/openingd/common.c @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include diff --git a/openingd/dualopend.c b/openingd/dualopend.c index b8acc78ab..fe36e140a 100644 --- a/openingd/dualopend.c +++ b/openingd/dualopend.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include diff --git a/openingd/openingd.c b/openingd/openingd.c index 33803a13d..447a0381f 100644 --- a/openingd/openingd.c +++ b/openingd/openingd.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include diff --git a/plugins/Makefile b/plugins/Makefile index 6309f0d0c..6396be75d 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -171,7 +171,6 @@ PLUGIN_COMMON_OBJS := \ common/random_select.o \ common/setup.o \ common/status_levels.o \ - common/type_to_string.o \ common/utils.o \ common/version.o \ common/wireaddr.o \ diff --git a/plugins/bkpr/bookkeeper.c b/plugins/bkpr/bookkeeper.c index 43cd76b57..50c027619 100644 --- a/plugins/bkpr/bookkeeper.c +++ b/plugins/bkpr/bookkeeper.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include diff --git a/plugins/bkpr/channelsapy.c b/plugins/bkpr/channelsapy.c index 4e81efa6c..8953553e5 100644 --- a/plugins/bkpr/channelsapy.c +++ b/plugins/bkpr/channelsapy.c @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include diff --git a/plugins/bkpr/incomestmt.c b/plugins/bkpr/incomestmt.c index ed6c49506..ab5269a98 100644 --- a/plugins/bkpr/incomestmt.c +++ b/plugins/bkpr/incomestmt.c @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include diff --git a/plugins/bkpr/recorder.c b/plugins/bkpr/recorder.c index 55c16789a..00f388fd8 100644 --- a/plugins/bkpr/recorder.c +++ b/plugins/bkpr/recorder.c @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include diff --git a/plugins/bkpr/test/Makefile b/plugins/bkpr/test/Makefile index e6f16016f..8a44b8409 100644 --- a/plugins/bkpr/test/Makefile +++ b/plugins/bkpr/test/Makefile @@ -19,7 +19,6 @@ BOOKKEEPER_TEST_COMMON_OBJS := \ common/node_id.o \ common/setup.o \ common/timeout.o \ - common/type_to_string.o \ common/utils.o \ common/version.o \ db/bindings.o \ diff --git a/plugins/chanbackup.c b/plugins/chanbackup.c index f63b5e672..454f6ca13 100644 --- a/plugins/chanbackup.c +++ b/plugins/chanbackup.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include diff --git a/plugins/fetchinvoice.c b/plugins/fetchinvoice.c index 133a1efeb..820f0ce88 100644 --- a/plugins/fetchinvoice.c +++ b/plugins/fetchinvoice.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include diff --git a/plugins/funder.c b/plugins/funder.c index 76ae3e6e8..3ab1d6bb9 100644 --- a/plugins/funder.c +++ b/plugins/funder.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include diff --git a/plugins/funder_policy.c b/plugins/funder_policy.c index 8a6196db8..78d7d435b 100644 --- a/plugins/funder_policy.c +++ b/plugins/funder_policy.c @@ -4,7 +4,6 @@ #include #include #include -#include #include #include diff --git a/plugins/keysend.c b/plugins/keysend.c index 1f0ef2cb7..5930fc32d 100644 --- a/plugins/keysend.c +++ b/plugins/keysend.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include diff --git a/plugins/libplugin-pay.c b/plugins/libplugin-pay.c index 54a9bcbc4..9b6002365 100644 --- a/plugins/libplugin-pay.c +++ b/plugins/libplugin-pay.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include diff --git a/plugins/offers_inv_hook.c b/plugins/offers_inv_hook.c index 49b447f51..d0fb9df65 100644 --- a/plugins/offers_inv_hook.c +++ b/plugins/offers_inv_hook.c @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include diff --git a/plugins/offers_invreq_hook.c b/plugins/offers_invreq_hook.c index f263fff14..da190d10e 100644 --- a/plugins/offers_invreq_hook.c +++ b/plugins/offers_invreq_hook.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include diff --git a/plugins/pay.c b/plugins/pay.c index 980c752f4..10fe4c6ad 100644 --- a/plugins/pay.c +++ b/plugins/pay.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include diff --git a/plugins/recover.c b/plugins/recover.c index 3ad20226a..07149f773 100644 --- a/plugins/recover.c +++ b/plugins/recover.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include diff --git a/plugins/renepay/flow.c b/plugins/renepay/flow.c index 9fbfb5ae7..a608559e1 100644 --- a/plugins/renepay/flow.c +++ b/plugins/renepay/flow.c @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include diff --git a/plugins/renepay/mcf.c b/plugins/renepay/mcf.c index 21467ef1a..8537b2cae 100644 --- a/plugins/renepay/mcf.c +++ b/plugins/renepay/mcf.c @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include diff --git a/plugins/renepay/pay.c b/plugins/renepay/pay.c index 0811b7253..f9d7207de 100644 --- a/plugins/renepay/pay.c +++ b/plugins/renepay/pay.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include diff --git a/plugins/renepay/pay_flow.h b/plugins/renepay/pay_flow.h index 2b54dc0e2..71ea459c5 100644 --- a/plugins/renepay/pay_flow.h +++ b/plugins/renepay/pay_flow.h @@ -3,7 +3,6 @@ #include "config.h" #include #include -#include #include #include #include diff --git a/plugins/renepay/test/run-mcf-diamond.c b/plugins/renepay/test/run-mcf-diamond.c index ee3688945..731eaca06 100644 --- a/plugins/renepay/test/run-mcf-diamond.c +++ b/plugins/renepay/test/run-mcf-diamond.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include diff --git a/plugins/renepay/test/run-mcf.c b/plugins/renepay/test/run-mcf.c index 1d5feb4ca..e9970ac77 100644 --- a/plugins/renepay/test/run-mcf.c +++ b/plugins/renepay/test/run-mcf.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include diff --git a/plugins/renepay/test/run-payflow_map.c b/plugins/renepay/test/run-payflow_map.c index 6a6fccd4d..ce4868640 100644 --- a/plugins/renepay/test/run-payflow_map.c +++ b/plugins/renepay/test/run-payflow_map.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include diff --git a/plugins/spender/multifundchannel.c b/plugins/spender/multifundchannel.c index d405c138e..ecaaa579a 100644 --- a/plugins/spender/multifundchannel.c +++ b/plugins/spender/multifundchannel.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include diff --git a/plugins/spender/multiwithdraw.c b/plugins/spender/multiwithdraw.c index 0d7dc81d3..9142ef36f 100644 --- a/plugins/spender/multiwithdraw.c +++ b/plugins/spender/multiwithdraw.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include diff --git a/plugins/spender/openchannel.c b/plugins/spender/openchannel.c index 9bc62228f..4519404de 100644 --- a/plugins/spender/openchannel.c +++ b/plugins/spender/openchannel.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #include diff --git a/plugins/sql.c b/plugins/sql.c index 41bf6ef23..effd4100f 100644 --- a/plugins/sql.c +++ b/plugins/sql.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include diff --git a/plugins/test/Makefile b/plugins/test/Makefile index da960a8e0..0165ee8c6 100644 --- a/plugins/test/Makefile +++ b/plugins/test/Makefile @@ -12,7 +12,6 @@ PLUGIN_TEST_COMMON_OBJS := \ common/autodata.o \ common/pseudorand.o \ common/setup.o \ - common/type_to_string.o \ common/utils.o plugins/test/run-route-overlong: \ diff --git a/plugins/topology.c b/plugins/topology.c index d4bf6c397..332d18bad 100644 --- a/plugins/topology.c +++ b/plugins/topology.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include diff --git a/plugins/txprepare.c b/plugins/txprepare.c index 4cf3d2427..d3728d435 100644 --- a/plugins/txprepare.c +++ b/plugins/txprepare.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include diff --git a/tests/fuzz/Makefile b/tests/fuzz/Makefile index 48de3c6dd..364661b6e 100644 --- a/tests/fuzz/Makefile +++ b/tests/fuzz/Makefile @@ -55,7 +55,6 @@ FUZZ_COMMON_OBJS := \ common/status.o \ common/status_wire.o \ common/status_wiregen.o \ - common/type_to_string.o \ common/utils.o \ common/version.o \ wire/bolt12_wiregen.o \ diff --git a/tools/Makefile b/tools/Makefile index 2576de380..ffde8377a 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -18,7 +18,7 @@ tools/headerversions: $(FORCE) tools/headerversions.o libccan.a tools/headerversions.o: ccan/config.h tools/check-bolt: tools/check-bolt.o $(TOOLS_COMMON_OBJS) -tools/hsmtool: tools/hsmtool.o $(TOOLS_COMMON_OBJS) $(BITCOIN_OBJS) common/amount.o common/autodata.o common/bech32.o common/bech32_util.o common/bigsize.o common/codex32.o common/configdir.o common/configvar.o common/derive_basepoints.o common/descriptor_checksum.o common/hsm_encryption.o common/node_id.o common/type_to_string.o common/version.o wire/fromwire.o wire/towire.o +tools/hsmtool: tools/hsmtool.o $(TOOLS_COMMON_OBJS) $(BITCOIN_OBJS) common/amount.o common/autodata.o common/bech32.o common/bech32_util.o common/bigsize.o common/codex32.o common/configdir.o common/configvar.o common/derive_basepoints.o common/descriptor_checksum.o common/hsm_encryption.o common/node_id.o common/version.o wire/fromwire.o wire/towire.o tools/lightning-hsmtool: tools/hsmtool cp $< $@ diff --git a/tools/hsmtool.c b/tools/hsmtool.c index 87e484585..40f2af233 100644 --- a/tools/hsmtool.c +++ b/tools/hsmtool.c @@ -1,4 +1,5 @@ #include "config.h" +#include #include #include #include @@ -17,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/wallet/reservation.c b/wallet/reservation.c index f334b2da2..36a2536d9 100644 --- a/wallet/reservation.c +++ b/wallet/reservation.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include diff --git a/wallet/test/Makefile b/wallet/test/Makefile index f5ab780e0..b49d4df44 100644 --- a/wallet/test/Makefile +++ b/wallet/test/Makefile @@ -17,7 +17,6 @@ WALLET_TEST_COMMON_OBJS := \ common/hsm_capable.o \ common/htlc_wire.o \ common/fee_states.o \ - common/type_to_string.o \ common/memleak.o \ common/node_id.o \ common/onionreply.o \ diff --git a/wallet/wallet.c b/wallet/wallet.c index e1e382ac9..241a8d2e2 100644 --- a/wallet/wallet.c +++ b/wallet/wallet.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include diff --git a/wallet/walletrpc.c b/wallet/walletrpc.c index 3e31c6a53..32d085230 100644 --- a/wallet/walletrpc.c +++ b/wallet/walletrpc.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include