lightningd: remove num_revocations_received.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-08-23 10:27:44 +09:30
committed by Christian Decker
parent a5d4a3eb2c
commit 1396cf6249
5 changed files with 3 additions and 22 deletions

View File

@@ -601,8 +601,7 @@ void add_peer(struct lightningd *ld, u64 unique_id,
peer->remote_shutdown_scriptpubkey = NULL;
peer->local_shutdown_idx = -1;
peer->next_index[LOCAL]
= peer->next_index[REMOTE]
= peer->num_revocations_received = 0;
= peer->next_index[REMOTE] = 0;
peer->next_htlc_id = 0;
peer->htlcs = tal_arr(peer, struct htlc_stub, 0);
wallet_shachain_init(ld->wallet, &peer->their_shachain);
@@ -1532,7 +1531,6 @@ static void peer_start_closingd(struct peer *peer,
num_revocations
= revocations_received(&peer->their_shachain.chain);
assert(num_revocations == peer->num_revocations_received);
/* BOLT #3:
*
@@ -1724,14 +1722,6 @@ static bool peer_start_channeld(struct peer *peer,
shutdown_scriptpubkey = NULL;
num_revocations = revocations_received(&peer->their_shachain.chain);
log_debug(peer->log, "peer->num_revocations_received = %"PRIu64
" min_index = %"PRIu64
" revocations_received() = %"PRIu64,
peer->num_revocations_received,
num_revocations,
peer->their_shachain.chain.min_index);
assert(num_revocations == peer->num_revocations_received);
initmsg = towire_channel_init(tmpctx,
&peer->ld->chainparams->genesis_blockhash,

View File

@@ -65,7 +65,6 @@ struct peer {
/* Tracking commitment transaction numbers. */
u64 next_index[NUM_SIDES];
u64 num_revocations_received;
u64 next_htlc_id;
/* Funding txid and amounts (once known) */

View File

@@ -1135,8 +1135,6 @@ int peer_got_revoke(struct peer *peer, const u8 *msg)
return -1;
}
assert(revocations_received(&peer->their_shachain.chain)
== peer->num_revocations_received);
if (revokenum != revocations_received(&peer->their_shachain.chain)) {
peer_internal_error(peer, "got_revoke: expected %"PRIu64
" got %"PRIu64,
@@ -1163,7 +1161,6 @@ int peer_got_revoke(struct peer *peer, const u8 *msg)
/* FIXME: Check per_commitment_secret -> per_commit_point */
update_per_commit_point(peer, &next_per_commitment_point);
peer->num_revocations_received++;
/* FIXME: Commit shachain and next_per_commit_point to db */