onchaind: don't create zero-output txs if fees overwhelm us.

They're illegal.  Instead do OP_RETURN so we don't pollute the UTXO.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-03-07 10:36:56 +10:30
committed by Christian Decker
parent 27c4e926bd
commit 45e145df5e
3 changed files with 17 additions and 4 deletions

View File

@@ -29,6 +29,9 @@ 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 */
u8 *scriptpubkey_opreturn(const tal_t *ctx);
/* Create an input script which spends p2pkh */
u8 *bitcoin_redeem_p2pkh(const tal_t *ctx, const struct pubkey *pubkey,
const secp256k1_ecdsa_signature *sig);