diff --git a/bitcoin/script.c b/bitcoin/script.c index f89bde4ff..a820717c2 100644 --- a/bitcoin/script.c +++ b/bitcoin/script.c @@ -286,13 +286,13 @@ u8 **bitcoin_witness_2of2(const tal_t *ctx, } /* Create a script for our HTLC output: sending. */ -u8 *scriptpubkey_htlc_send(const tal_t *ctx, - const struct pubkey *ourkey, - const struct pubkey *theirkey, - const struct abs_locktime *htlc_abstimeout, - const struct rel_locktime *locktime, - const struct sha256 *commit_revoke, - const struct sha256 *rhash) +u8 *bitcoin_redeem_htlc_send(const tal_t *ctx, + const struct pubkey *ourkey, + const struct pubkey *theirkey, + const struct abs_locktime *htlc_abstimeout, + const struct rel_locktime *locktime, + const struct sha256 *commit_revoke, + const struct sha256 *rhash) { /* R value presented: -> them. * Commit revocation value presented: -> them. @@ -334,13 +334,13 @@ u8 *scriptpubkey_htlc_send(const tal_t *ctx, } /* Create a script for our HTLC output: receiving. */ -u8 *scriptpubkey_htlc_recv(const tal_t *ctx, - const struct pubkey *ourkey, - const struct pubkey *theirkey, - const struct abs_locktime *htlc_abstimeout, - const struct rel_locktime *locktime, - const struct sha256 *commit_revoke, - const struct sha256 *rhash) +u8 *bitcoin_redeem_htlc_recv(const tal_t *ctx, + const struct pubkey *ourkey, + const struct pubkey *theirkey, + const struct abs_locktime *htlc_abstimeout, + const struct rel_locktime *locktime, + const struct sha256 *commit_revoke, + const struct sha256 *rhash) { /* R value presented: -> us. * Commit revocation value presented: -> them. diff --git a/bitcoin/script.h b/bitcoin/script.h index ae78d8cdc..74db37fce 100644 --- a/bitcoin/script.h +++ b/bitcoin/script.h @@ -50,22 +50,23 @@ void bitcoin_witness_p2sh_p2wpkh(const tal_t *ctx, /* Create scriptcode (fake witness, basically) for P2WPKH */ u8 *p2wpkh_scriptcode(const tal_t *ctx, const struct pubkey *key); -u8 *scriptpubkey_htlc_send(const tal_t *ctx, - const struct pubkey *ourkey, - const struct pubkey *theirkey, - const struct abs_locktime *htlc_abstimeout, - const struct rel_locktime *locktime, - const struct sha256 *commit_revoke, - const struct sha256 *rhash); +/* Create a script for our HTLC output: sending. */ +u8 *bitcoin_redeem_htlc_send(const tal_t *ctx, + const struct pubkey *ourkey, + const struct pubkey *theirkey, + const struct abs_locktime *htlc_abstimeout, + const struct rel_locktime *locktime, + const struct sha256 *commit_revoke, + const struct sha256 *rhash); /* Create a script for our HTLC output: receiving. */ -u8 *scriptpubkey_htlc_recv(const tal_t *ctx, - const struct pubkey *ourkey, - const struct pubkey *theirkey, - const struct abs_locktime *htlc_abstimeout, - const struct rel_locktime *locktime, - const struct sha256 *commit_revoke, - const struct sha256 *rhash); +u8 *bitcoin_redeem_htlc_recv(const tal_t *ctx, + const struct pubkey *ourkey, + const struct pubkey *theirkey, + const struct abs_locktime *htlc_abstimeout, + const struct rel_locktime *locktime, + const struct sha256 *commit_revoke, + const struct sha256 *rhash); /* Create an output script for a 32-byte witness program. */ u8 *scriptpubkey_p2wsh(const tal_t *ctx, const u8 *witnessscript); diff --git a/commit_tx.c b/commit_tx.c index c20576015..55f8fc7a7 100644 --- a/commit_tx.c +++ b/commit_tx.c @@ -82,7 +82,7 @@ struct bitcoin_tx *create_commit_tx(const tal_t *ctx, for (i = 0; i < tal_count(cstate->a.htlcs); i++) { if (!add_htlc(tx, num, &cstate->a.htlcs[i], our_final, their_final, - rhash, their_locktime, scriptpubkey_htlc_send)) + rhash, their_locktime, bitcoin_redeem_htlc_send)) return tal_free(tx); total += tx->output[num++].amount; } @@ -90,7 +90,7 @@ struct bitcoin_tx *create_commit_tx(const tal_t *ctx, for (i = 0; i < tal_count(cstate->b.htlcs); i++) { if (!add_htlc(tx, num, &cstate->b.htlcs[i], our_final, their_final, - rhash, their_locktime, scriptpubkey_htlc_recv)) + rhash, their_locktime, bitcoin_redeem_htlc_recv)) return tal_free(tx); total += tx->output[num++].amount; }