mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
bitcoin/script.c: Add scriptpubkey_opreturn_padded, which creates an OP_RETURN with a pointless random 20-byte padding.
In the case of `donateutxo`, this is needed since a simple spend of a P2WPKH to an `OP_RETURN` would be below the minimum transaction size. Sizes below 20 are not plausible as commitments.
This commit is contained in:
committed by
Rusty Russell
parent
ee276bcb86
commit
6c13e9b300
@@ -30,6 +30,11 @@ u8 *scriptpubkey_p2pkh(const tal_t *ctx, const struct bitcoin_address *addr);
|
||||
|
||||
/* Create a prunable output script */
|
||||
u8 *scriptpubkey_opreturn(const tal_t *ctx);
|
||||
/* 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,
|
||||
|
||||
Reference in New Issue
Block a user