Browse Source

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>
ppa-0.6.1
Rusty Russell 9 years ago
parent
commit
bc8cd0dce7
  1. 19
      test/test_protocol.c

19
test/test_protocol.c

@ -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;
/* 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]);
ci->funding = ci->funding_next;
assert(structeq(&ci->funding, &ci->funding_next));
return ci;
}

Loading…
Cancel
Save