From 58a62e782d120abb975852bbd8d1efe66d5e8ef3 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 24 Sep 2015 14:56:01 +0930 Subject: [PATCH] bitcoin/script: don't pass value for HTLC script. We don't need it. Signed-off-by: Rusty Russell --- bitcoin/script.c | 2 -- bitcoin/script.h | 2 -- commit_tx.c | 3 +-- test-cli/create-htlc-spend-tx.c | 4 ++-- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/bitcoin/script.c b/bitcoin/script.c index 66bb4ab46..75701c563 100644 --- a/bitcoin/script.c +++ b/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, const struct pubkey *ourkey, const struct pubkey *theirkey, - uint64_t value, uint32_t htlc_abstimeout, uint32_t locktime, 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, const struct pubkey *ourkey, const struct pubkey *theirkey, - uint64_t value, uint32_t htlc_abstimeout, uint32_t locktime, const struct sha256 *commit_revoke, diff --git a/bitcoin/script.h b/bitcoin/script.h index 79b5ab4be..641e754af 100644 --- a/bitcoin/script.h +++ b/bitcoin/script.h @@ -41,7 +41,6 @@ u8 *scriptsig_pay_to_pubkeyhash(const tal_t *ctx, u8 *scriptpubkey_htlc_send(const tal_t *ctx, const struct pubkey *ourkey, const struct pubkey *theirkey, - uint64_t value, uint32_t htlc_abstimeout, uint32_t locktime, 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, const struct pubkey *ourkey, const struct pubkey *theirkey, - uint64_t value, uint32_t htlc_abstimeout, uint32_t locktime, const struct sha256 *commit_revoke, diff --git a/commit_tx.c b/commit_tx.c index 21161f6de..064e5abd1 100644 --- a/commit_tx.c +++ b/commit_tx.c @@ -18,7 +18,6 @@ static bool add_htlc(struct bitcoin_tx *tx, size_t n, u8 *(*scriptpubkeyfn)(const tal_t *, const struct pubkey *, const struct pubkey *, - uint64_t, uint32_t, uint32_t, 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); tx->output[n].script = scriptpubkey_p2sh(tx, - scriptpubkeyfn(tx, ourkey, theirkey, h->amount, + scriptpubkeyfn(tx, ourkey, theirkey, htlc_abstime, locktime, rhash, &htlc_rhash)); tx->output[n].script_length = tal_count(tx->output[n].script); diff --git a/test-cli/create-htlc-spend-tx.c b/test-cli/create-htlc-spend-tx.c index 42bb8c489..290220c3d 100644 --- a/test-cli/create-htlc-spend-tx.c +++ b/test-cli/create-htlc-spend-tx.c @@ -116,12 +116,12 @@ int main(int argc, char *argv[]) if (received) { redeemscript = scriptpubkey_htlc_recv(ctx, &pubkey1, &pubkey2, - u->amount, htlc_abstimeout, + htlc_abstimeout, locktime, &revoke_hash, &htlc_rhash); } else { redeemscript = scriptpubkey_htlc_send(ctx, &pubkey1, &pubkey2, - u->amount, htlc_abstimeout, + htlc_abstimeout, locktime, &revoke_hash, &htlc_rhash); }