mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +01:00
test/test_protocol: don't manually reapply changes.
This finished the previous patch by simply copying funding_next to funding when we want to apply changes. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
52db7ae0c4
commit
bc8cd0dce7
1 changed files with 1 additions and 18 deletions
|
@ -165,25 +165,8 @@ static struct commit_info *apply_changes(const tal_t *ctx,
|
|||
struct commit_info *old)
|
||||
{
|
||||
struct commit_info *ci = new_commit_info(ctx, old);
|
||||
size_t i, n;
|
||||
ci->funding = ci->funding_next;
|
||||
|
||||
/* Changes they offered. */
|
||||
n = tal_count(old->changes_incoming);
|
||||
for (i = 0; i < n; i++)
|
||||
do_change(&ci->funding.inhtlcs,
|
||||
&ci->funding.outhtlcs,
|
||||
NULL,
|
||||
old->changes_incoming[i]);
|
||||
|
||||
/* Changes we offered. */
|
||||
n = tal_count(old->changes_outgoing);
|
||||
for (i = 0; i < n; i++)
|
||||
do_change(&ci->funding.outhtlcs,
|
||||
&ci->funding.inhtlcs,
|
||||
&ci->funding.fee,
|
||||
old->changes_outgoing[i]);
|
||||
|
||||
assert(structeq(&ci->funding, &ci->funding_next));
|
||||
return ci;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue