mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-03 18:57:06 +01:00
script: rename scriptpubkey_htlc_send to/recv bitcoin_redeem_htlc_send/recv
They could be scriptpubkeys, but they're actually used inside p2wsh, so they're really witness scripts. We use the term "redeem" elsewhere from when we were using p2sh, though. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
e18aea8d71
commit
02593059cd
3 changed files with 31 additions and 30 deletions
|
@ -286,7 +286,7 @@ u8 **bitcoin_witness_2of2(const tal_t *ctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create a script for our HTLC output: sending. */
|
/* Create a script for our HTLC output: sending. */
|
||||||
u8 *scriptpubkey_htlc_send(const tal_t *ctx,
|
u8 *bitcoin_redeem_htlc_send(const tal_t *ctx,
|
||||||
const struct pubkey *ourkey,
|
const struct pubkey *ourkey,
|
||||||
const struct pubkey *theirkey,
|
const struct pubkey *theirkey,
|
||||||
const struct abs_locktime *htlc_abstimeout,
|
const struct abs_locktime *htlc_abstimeout,
|
||||||
|
@ -334,7 +334,7 @@ u8 *scriptpubkey_htlc_send(const tal_t *ctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create a script for our HTLC output: receiving. */
|
/* Create a script for our HTLC output: receiving. */
|
||||||
u8 *scriptpubkey_htlc_recv(const tal_t *ctx,
|
u8 *bitcoin_redeem_htlc_recv(const tal_t *ctx,
|
||||||
const struct pubkey *ourkey,
|
const struct pubkey *ourkey,
|
||||||
const struct pubkey *theirkey,
|
const struct pubkey *theirkey,
|
||||||
const struct abs_locktime *htlc_abstimeout,
|
const struct abs_locktime *htlc_abstimeout,
|
||||||
|
|
|
@ -50,7 +50,8 @@ void bitcoin_witness_p2sh_p2wpkh(const tal_t *ctx,
|
||||||
/* Create scriptcode (fake witness, basically) for P2WPKH */
|
/* Create scriptcode (fake witness, basically) for P2WPKH */
|
||||||
u8 *p2wpkh_scriptcode(const tal_t *ctx, const struct pubkey *key);
|
u8 *p2wpkh_scriptcode(const tal_t *ctx, const struct pubkey *key);
|
||||||
|
|
||||||
u8 *scriptpubkey_htlc_send(const tal_t *ctx,
|
/* Create a script for our HTLC output: sending. */
|
||||||
|
u8 *bitcoin_redeem_htlc_send(const tal_t *ctx,
|
||||||
const struct pubkey *ourkey,
|
const struct pubkey *ourkey,
|
||||||
const struct pubkey *theirkey,
|
const struct pubkey *theirkey,
|
||||||
const struct abs_locktime *htlc_abstimeout,
|
const struct abs_locktime *htlc_abstimeout,
|
||||||
|
@ -59,7 +60,7 @@ u8 *scriptpubkey_htlc_send(const tal_t *ctx,
|
||||||
const struct sha256 *rhash);
|
const struct sha256 *rhash);
|
||||||
|
|
||||||
/* Create a script for our HTLC output: receiving. */
|
/* Create a script for our HTLC output: receiving. */
|
||||||
u8 *scriptpubkey_htlc_recv(const tal_t *ctx,
|
u8 *bitcoin_redeem_htlc_recv(const tal_t *ctx,
|
||||||
const struct pubkey *ourkey,
|
const struct pubkey *ourkey,
|
||||||
const struct pubkey *theirkey,
|
const struct pubkey *theirkey,
|
||||||
const struct abs_locktime *htlc_abstimeout,
|
const struct abs_locktime *htlc_abstimeout,
|
||||||
|
|
|
@ -82,7 +82,7 @@ struct bitcoin_tx *create_commit_tx(const tal_t *ctx,
|
||||||
for (i = 0; i < tal_count(cstate->a.htlcs); i++) {
|
for (i = 0; i < tal_count(cstate->a.htlcs); i++) {
|
||||||
if (!add_htlc(tx, num, &cstate->a.htlcs[i],
|
if (!add_htlc(tx, num, &cstate->a.htlcs[i],
|
||||||
our_final, their_final,
|
our_final, their_final,
|
||||||
rhash, their_locktime, scriptpubkey_htlc_send))
|
rhash, their_locktime, bitcoin_redeem_htlc_send))
|
||||||
return tal_free(tx);
|
return tal_free(tx);
|
||||||
total += tx->output[num++].amount;
|
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++) {
|
for (i = 0; i < tal_count(cstate->b.htlcs); i++) {
|
||||||
if (!add_htlc(tx, num, &cstate->b.htlcs[i],
|
if (!add_htlc(tx, num, &cstate->b.htlcs[i],
|
||||||
our_final, their_final,
|
our_final, their_final,
|
||||||
rhash, their_locktime, scriptpubkey_htlc_recv))
|
rhash, their_locktime, bitcoin_redeem_htlc_recv))
|
||||||
return tal_free(tx);
|
return tal_free(tx);
|
||||||
total += tx->output[num++].amount;
|
total += tx->output[num++].amount;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue