Skip to content

Commit 3f44437

Browse files
committed
[FAB-4475] Sync gossip ledger height & metastate
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 <[email protected]>
1 parent 8589b83 commit 3f44437

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

gossip/state/state.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -460,9 +460,13 @@ func (s *GossipStateProviderImpl) antiEntropy() {
460460
logger.Error("Cannot obtain ledger height, due to", err)
461461
continue
462462
}
463+
if current == 0 {
464+
logger.Error("Ledger reported block height of 0 but this should be impossible")
465+
continue
466+
}
463467
max := s.maxAvailableLedgerHeight()
464468

465-
if current == max {
469+
if current-1 >= max {
466470
continue
467471
}
468472

0 commit comments

Comments
 (0)