daemon: move unacked queue into commit_info struct.

We're about to allow changes while we're waiting for a commit ack.
This means we can't have a single "unacked changes" queue; when we
receive the revocation reply, we need to apply the unacked changes
known at the time we sent the commit, not any we've created since
then.

Note that we still only have a single staged_commit; we never have two
outstanding commits, since for simplicity we will still block
following update_commit pending the reply to the current one.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2016-05-26 15:25:25 +09:30
parent 36fc62ab81
commit d4862938c8
3 changed files with 39 additions and 38 deletions

View File

@@ -69,6 +69,8 @@ struct commit_info {
int *map;
/* Revocation preimage (if known). */
struct sha256 *revocation_preimage;
/* unacked changes (already applied to staging_cstate) */
union htlc_staging *unacked_changes;
};
struct peer_visible_state {
@@ -89,8 +91,6 @@ struct peer_visible_state {
/* cstate to generate next commitment tx. */
struct channel_state *staging_cstate;
/* unacked changes (already applied to staging_cstate) */
union htlc_staging *unacked_changes;
};
struct htlc_progress {