Skip to content

Commit

Permalink
[FAB-4475] Sync gossip ledger height & metastate
Browse files Browse the repository at this point in the history
The state transfer asks the ledger what is its ledger height, but
compares the height to the maximum block number of the peers of the channel
which is always 1 behind the ledger height, since block sequence of 0
means ledger height of 1.

Change-Id: If7ff1ad56ae765c8cdadf9b9725dc18a05b49691
Signed-off-by: Yacov Manevich <yacovm@il.ibm.com>
  • Loading branch information
yacovm committed Jun 9, 2017
1 parent 8589b83 commit 3f44437
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gossip/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,13 @@ func (s *GossipStateProviderImpl) antiEntropy() {
logger.Error("Cannot obtain ledger height, due to", err)
continue
}
if current == 0 {
logger.Error("Ledger reported block height of 0 but this should be impossible")
continue
}
max := s.maxAvailableLedgerHeight()

if current == max {
if current-1 >= max {
continue
}

Expand Down

0 comments on commit 3f44437

Please sign in to comment.