txs: Move commit tx generation out of the signature computation

We need the txs around, so don't throw them away after generating them.
This commit is contained in:
Christian Decker
2020-05-07 10:13:34 +09:30
committed by Rusty Russell
parent 667a763659
commit eb8eabcc3c
13 changed files with 108 additions and 45 deletions

View File

@@ -397,8 +397,9 @@ int main(int argc, char *argv[])
if (!per_commit_point(&localseed, &local_per_commit_point, commitnum))
errx(1, "Bad deriving local per-commitment-point");
local_txs = channel_txs(NULL, &htlcmap, &funding_wscript, channel,
&local_per_commit_point, commitnum, LOCAL);
local_txs = channel_txs(NULL, &htlcmap, NULL, &funding_wscript, channel,
&local_per_commit_point, commitnum,
LOCAL);
printf("## local_commitment\n"
"# input amount %s, funding_wscript %s, pubkey %s\n",
@@ -511,8 +512,9 @@ int main(int argc, char *argv[])
/* Create the remote commitment tx */
if (!per_commit_point(&remoteseed, &remote_per_commit_point, commitnum))
errx(1, "Bad deriving remote per-commitment-point");
remote_txs = channel_txs(NULL, &htlcmap, &funding_wscript, channel,
&remote_per_commit_point, commitnum, REMOTE);
remote_txs = channel_txs(NULL, &htlcmap, NULL, &funding_wscript, channel,
&remote_per_commit_point, commitnum,
REMOTE);
remote_txs[0]->input_amounts[0]
= tal_dup(remote_txs[0], struct amount_sat, &funding_amount);