mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
open-anchor-scriptsig: use pubkey, not addr in scriptsig.
Oops. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
50609c6771
commit
abac31072e
@ -154,13 +154,13 @@ u8 *scriptpubkey_pay_to_pubkeyhash(const tal_t *ctx,
|
||||
}
|
||||
|
||||
u8 *scriptsig_pay_to_pubkeyhash(const tal_t *ctx,
|
||||
const struct bitcoin_address *addr,
|
||||
const struct pubkey *key,
|
||||
const struct signature *sig)
|
||||
{
|
||||
u8 *script = tal_arr(ctx, u8, 0);
|
||||
|
||||
add_push_sig(&script, sig);
|
||||
add_push_bytes(&script, addr, sizeof(*addr));
|
||||
add_push_key(&script, key);
|
||||
|
||||
return script;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ u8 *scriptpubkey_pay_to_pubkeyhash(const tal_t *ctx,
|
||||
|
||||
/* Create an input script to accept pay to pubkey */
|
||||
u8 *scriptsig_pay_to_pubkeyhash(const tal_t *ctx,
|
||||
const struct bitcoin_address *addr,
|
||||
const struct pubkey *key,
|
||||
const struct signature *sig);
|
||||
|
||||
/* Create an input script to accept pay to pubkey */
|
||||
|
@ -27,7 +27,6 @@ static u8 *tx_scriptsig(const tal_t *ctx,
|
||||
const struct pubkey *pubkey)
|
||||
{
|
||||
struct signature *sig;
|
||||
struct bitcoin_address addr;
|
||||
|
||||
sig = sign_tx_input(ctx, tx, i,
|
||||
input->subscript.data, input->subscript.len,
|
||||
@ -37,8 +36,7 @@ static u8 *tx_scriptsig(const tal_t *ctx,
|
||||
|
||||
if (!is_pay_to_pubkey_hash(input->subscript.data, input->subscript.len))
|
||||
errx(1, "FIXME: Don't know how to handle input");
|
||||
bitcoin_address(pubkey, &addr);
|
||||
return scriptsig_pay_to_pubkeyhash(ctx, &addr, sig);
|
||||
return scriptsig_pay_to_pubkeyhash(ctx, pubkey, sig);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
|
Loading…
Reference in New Issue
Block a user