close_tx: initialize fee and input amount fields.

Required for alpha.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2015-07-01 14:42:30 +09:30
parent 90e4160862
commit 1075264c66
4 changed files with 13 additions and 5 deletions

View File

@@ -28,7 +28,7 @@ int main(int argc, char *argv[])
u8 *redeemscript;
CloseChannel *close;
CloseChannelComplete *closecomplete;
size_t i;
size_t i, anchor_out;
int64_t delta;
err_set_progname(argv[0]);
@@ -69,8 +69,10 @@ int main(int argc, char *argv[])
redeemscript = bitcoin_redeem_2of2(ctx, &pubkey1, &pubkey2);
/* Now create the close tx to spend 2/2 output of anchor. */
anchor_out = find_p2sh_out(anchor, redeemscript);
close_tx = create_close_tx(ctx, o1, o2, delta, &anchor_txid,
find_p2sh_out(anchor, redeemscript));
anchor->output[anchor_out].amount,
anchor_out);
/* Signatures well-formed? */
sig1.stype = sig2.stype = SIGHASH_ALL;