From bc8cd0dce7f2f16121ef4f47a46d4bf5ee920e5d Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 17 May 2016 13:55:58 +0930 Subject: [PATCH] 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 --- test/test_protocol.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/test/test_protocol.c b/test/test_protocol.c index 444c3afb8..ca4c9dc40 100644 --- a/test/test_protocol.c +++ b/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; + 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; }