channeld: rename commit_index to next_index.

This is what it actually is, and makes it clearer when we refer to the
spec.  It's the commitment we're currently updating, which is the next
commitment.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-06-27 12:25:06 +09:30
committed by Christian Decker
parent d411b07ba2
commit 42c9cb58c7
5 changed files with 48 additions and 50 deletions

View File

@@ -377,8 +377,8 @@ void add_peer(struct lightningd *ld, u64 unique_id,
peer->last_sent_commit = NULL;
peer->remote_shutdown_scriptpubkey = NULL;
peer->local_shutdown_idx = -1;
peer->commit_index[LOCAL]
= peer->commit_index[REMOTE]
peer->next_index[LOCAL]
= peer->next_index[REMOTE]
= peer->num_revocations_received = 0;
peer->next_htlc_id = 0;
shachain_init(&peer->their_shachain);
@@ -1192,8 +1192,8 @@ static bool peer_start_channeld(struct peer *peer,
cfg->deadline_blocks,
peer->last_was_revoke,
peer->last_sent_commit,
peer->commit_index[LOCAL],
peer->commit_index[REMOTE],
peer->next_index[LOCAL],
peer->next_index[REMOTE],
peer->num_revocations_received,
peer->next_htlc_id,
htlcs, htlc_states,
@@ -1215,7 +1215,7 @@ static bool peer_start_channeld(struct peer *peer,
static bool peer_commit_initial(struct peer *peer)
{
peer->commit_index[LOCAL] = peer->commit_index[REMOTE] = 1;
peer->next_index[LOCAL] = peer->next_index[REMOTE] = 1;
/* FIXME: Db channel_info, etc. */
return true;