mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-11 01:54:25 +01:00
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:
@@ -32,7 +32,7 @@ int main(int argc, char *argv[])
|
||||
struct pubkey pubkey1, pubkey2;
|
||||
u8 *redeemscript;
|
||||
int64_t delta;
|
||||
size_t i;
|
||||
size_t i, anchor_out;
|
||||
|
||||
err_set_progname(argv[0]);
|
||||
|
||||
@@ -81,9 +81,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
/* Now create the close tx to spend 2/2 output of anchor. */
|
||||
/* Assumes that updates are all from closer -> closee */
|
||||
anchor_out = find_p2sh_out(anchor, redeemscript);
|
||||
close_tx = create_close_tx(ctx, o1, o2, complete ? -delta : delta,
|
||||
&anchor_txid,
|
||||
find_p2sh_out(anchor, redeemscript));
|
||||
&anchor_txid,
|
||||
anchor->output[anchor_out].amount,
|
||||
anchor_out);
|
||||
|
||||
/* Sign it for them. */
|
||||
sign_tx_input(ctx, close_tx, 0, redeemscript, tal_count(redeemscript),
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user