Browse Source

bitcoin/script: don't pass value for HTLC script.

We don't need it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 9 years ago
parent
commit
58a62e782d
  1. 2
      bitcoin/script.c
  2. 2
      bitcoin/script.h
  3. 3
      commit_tx.c
  4. 4
      test-cli/create-htlc-spend-tx.c

2
bitcoin/script.c

@ -181,7 +181,6 @@ u8 *scriptpubkey_p2sh(const tal_t *ctx, const u8 *redeemscript)
u8 *scriptpubkey_htlc_send(const tal_t *ctx, u8 *scriptpubkey_htlc_send(const tal_t *ctx,
const struct pubkey *ourkey, const struct pubkey *ourkey,
const struct pubkey *theirkey, const struct pubkey *theirkey,
uint64_t value,
uint32_t htlc_abstimeout, uint32_t htlc_abstimeout,
uint32_t locktime, uint32_t locktime,
const struct sha256 *commit_revoke, const struct sha256 *commit_revoke,
@ -230,7 +229,6 @@ u8 *scriptpubkey_htlc_send(const tal_t *ctx,
u8 *scriptpubkey_htlc_recv(const tal_t *ctx, u8 *scriptpubkey_htlc_recv(const tal_t *ctx,
const struct pubkey *ourkey, const struct pubkey *ourkey,
const struct pubkey *theirkey, const struct pubkey *theirkey,
uint64_t value,
uint32_t htlc_abstimeout, uint32_t htlc_abstimeout,
uint32_t locktime, uint32_t locktime,
const struct sha256 *commit_revoke, const struct sha256 *commit_revoke,

2
bitcoin/script.h

@ -41,7 +41,6 @@ u8 *scriptsig_pay_to_pubkeyhash(const tal_t *ctx,
u8 *scriptpubkey_htlc_send(const tal_t *ctx, u8 *scriptpubkey_htlc_send(const tal_t *ctx,
const struct pubkey *ourkey, const struct pubkey *ourkey,
const struct pubkey *theirkey, const struct pubkey *theirkey,
uint64_t value,
uint32_t htlc_abstimeout, uint32_t htlc_abstimeout,
uint32_t locktime, uint32_t locktime,
const struct sha256 *commit_revoke, const struct sha256 *commit_revoke,
@ -51,7 +50,6 @@ u8 *scriptpubkey_htlc_send(const tal_t *ctx,
u8 *scriptpubkey_htlc_recv(const tal_t *ctx, u8 *scriptpubkey_htlc_recv(const tal_t *ctx,
const struct pubkey *ourkey, const struct pubkey *ourkey,
const struct pubkey *theirkey, const struct pubkey *theirkey,
uint64_t value,
uint32_t htlc_abstimeout, uint32_t htlc_abstimeout,
uint32_t locktime, uint32_t locktime,
const struct sha256 *commit_revoke, const struct sha256 *commit_revoke,

3
commit_tx.c

@ -18,7 +18,6 @@ static bool add_htlc(struct bitcoin_tx *tx, size_t n,
u8 *(*scriptpubkeyfn)(const tal_t *, u8 *(*scriptpubkeyfn)(const tal_t *,
const struct pubkey *, const struct pubkey *,
const struct pubkey *, const struct pubkey *,
uint64_t,
uint32_t, uint32_t,
uint32_t, uint32_t,
const struct sha256 *, const struct sha256 *,
@ -35,7 +34,7 @@ static bool add_htlc(struct bitcoin_tx *tx, size_t n,
proto_to_sha256(h->r_hash, &htlc_rhash); proto_to_sha256(h->r_hash, &htlc_rhash);
tx->output[n].script = scriptpubkey_p2sh(tx, tx->output[n].script = scriptpubkey_p2sh(tx,
scriptpubkeyfn(tx, ourkey, theirkey, h->amount, scriptpubkeyfn(tx, ourkey, theirkey,
htlc_abstime, locktime, rhash, htlc_abstime, locktime, rhash,
&htlc_rhash)); &htlc_rhash));
tx->output[n].script_length = tal_count(tx->output[n].script); tx->output[n].script_length = tal_count(tx->output[n].script);

4
test-cli/create-htlc-spend-tx.c

@ -116,12 +116,12 @@ int main(int argc, char *argv[])
if (received) { if (received) {
redeemscript = scriptpubkey_htlc_recv(ctx, &pubkey1, &pubkey2, redeemscript = scriptpubkey_htlc_recv(ctx, &pubkey1, &pubkey2,
u->amount, htlc_abstimeout, htlc_abstimeout,
locktime, &revoke_hash, locktime, &revoke_hash,
&htlc_rhash); &htlc_rhash);
} else { } else {
redeemscript = scriptpubkey_htlc_send(ctx, &pubkey1, &pubkey2, redeemscript = scriptpubkey_htlc_send(ctx, &pubkey1, &pubkey2,
u->amount, htlc_abstimeout, htlc_abstimeout,
locktime, &revoke_hash, locktime, &revoke_hash,
&htlc_rhash); &htlc_rhash);
} }

Loading…
Cancel
Save