From 4bc357f0a65c0e8612511f0e01fbac6f29b08348 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 23 Oct 2025 10:09:12 +1030 Subject: [PATCH] bitcoin: remove unused scriptpubkey_opreturn_padded. I noticed, because it pulled in randomness routines. Signed-off-by: Rusty Russell --- bitcoin/script.c | 11 ----------- bitcoin/script.h | 6 ------ 2 files changed, 17 deletions(-) diff --git a/bitcoin/script.c b/bitcoin/script.c index 73367f5bc..1c703dbbf 100644 --- a/bitcoin/script.c +++ b/bitcoin/script.c @@ -187,17 +187,6 @@ u8 *scriptpubkey_p2pkh(const tal_t *ctx, const struct bitcoin_address *addr) return script; } -u8 *scriptpubkey_opreturn_padded(const tal_t *ctx) -{ - u8 *script = tal_arr(ctx, u8, 0); - u8 random[20]; - randombytes_buf(random, sizeof(random)); - - add_op(&script, OP_RETURN); - script_push_bytes(&script, random, sizeof(random)); - return script; -} - /* Create an input script which spends p2pkh */ u8 *bitcoin_redeem_p2pkh(const tal_t *ctx, const struct pubkey *pubkey, const struct bitcoin_signature *sig) diff --git a/bitcoin/script.h b/bitcoin/script.h index ccbad3bfe..52be6626c 100644 --- a/bitcoin/script.h +++ b/bitcoin/script.h @@ -26,12 +26,6 @@ u8 *scriptpubkey_p2sh_hash(const tal_t *ctx, const struct ripemd160 *redeemhash) /* Create an output script using p2pkh */ u8 *scriptpubkey_p2pkh(const tal_t *ctx, const struct bitcoin_address *addr); -/* Create a prunable output script with 20 random bytes. - * This is needed since a spend from a p2wpkh to an `OP_RETURN` without - * any other outputs would result in a transaction smaller than the - * minimum size. */ -u8 *scriptpubkey_opreturn_padded(const tal_t *ctx); - /* Create an input script which spends p2pkh */ u8 *bitcoin_redeem_p2pkh(const tal_t *ctx, const struct pubkey *pubkey, const struct bitcoin_signature *sig);