mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +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:
@@ -165,25 +165,8 @@ static struct commit_info *apply_changes(const tal_t *ctx,
|
|||||||
struct commit_info *old)
|
struct commit_info *old)
|
||||||
{
|
{
|
||||||
struct commit_info *ci = new_commit_info(ctx, 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;
|
return ci;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user