bitcoin: remove unused functions, or make static.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2021-12-04 21:55:06 +10:30
parent f64df6fbb5
commit d9968bbc0c
48 changed files with 28 additions and 574 deletions

View File

@@ -16,7 +16,7 @@ WIRE_TEST_COMMON_OBJS := \
common/utils.o
# run-tlvstream.c needs to reach into bitcoin/pubkey for SUPERVERBOSE
$(WIRE_TEST_PROGRAMS): $(WIRE_TEST_COMMON_OBJS) $(filter-out bitcoin/pubkey.o,$(BITCOIN_OBJS))
$(WIRE_TEST_PROGRAMS): $(WIRE_TEST_COMMON_OBJS) $(filter-out bitcoin/pubkey.o bitcoin/chainparams.o,$(BITCOIN_OBJS))
# We put a dependency on non-exp sources here, so they get built even if
# we're EXPERIMENTAL_FEATURES.

View File

@@ -3,6 +3,7 @@
#include "../fromwire.c"
#include "../peer_wire.c"
#include "bitcoin/pubkey.c"
#include "bitcoin/chainparams.c"
#include "common/amount.c"
#include "common/channel_id.c"
#include "common/node_id.c"
@@ -1019,7 +1020,6 @@ int main(int argc, char *argv[])
void *ctx = tal(NULL, char);
size_t i;
u8 *msg;
const struct chainparams **chains;
common_setup(argv[0]);
@@ -1099,8 +1099,7 @@ int main(int argc, char *argv[])
assert(error_eq(&e, e2));
test_corruption(&e, e2, error);
chains = chainparams_for_networks(ctx);
for (i = 0; i < tal_count(chains); i++) {
for (i = 0; i < ARRAY_SIZE(networks); i++) {
memset(&init, 2, sizeof(init));
init.globalfeatures = tal_arr(ctx, u8, 2);
memset(init.globalfeatures, 2, 2);
@@ -1108,7 +1107,7 @@ int main(int argc, char *argv[])
memset(init.localfeatures, 2, 2);
init.tlvs = tlv_init_tlvs_new(ctx);
init.tlvs->networks = tal_arr(init.tlvs, struct bitcoin_blkid, 1);
init.tlvs->networks[0] = chains[i]->genesis_blockhash;
init.tlvs->networks[0] = networks[i].genesis_blockhash;
msg = towire_struct_init(ctx, &init);
init2 = fromwire_struct_init(ctx, msg);
assert(init_eq(&init, init2));

View File

@@ -22,6 +22,9 @@ static const char *reason;
#include <wire/tlvstream.c>
/* AUTOGENERATED MOCKS START */
/* Generated stub for chainparams_by_chainhash */
const struct chainparams *chainparams_by_chainhash(const struct bitcoin_blkid *chain_hash UNNEEDED)
{ fprintf(stderr, "chainparams_by_chainhash called!\n"); abort(); }
/* Generated stub for fromwire_channel_id */
void fromwire_channel_id(const u8 **cursor UNNEEDED, size_t *max UNNEEDED,
struct channel_id *channel_id UNNEEDED)