Skip to content

Little log information error #5265

@zhanghefan123

Description

@zhanghefan123

Description

In fabric-3.0.0/orderer/consensus/smartbft/synchronizer_bft.go, the debug log message contains an incorrect annotation. When the number of reported heights is insufficient (len(heights) < f+1), the log states it's returning heights[0] (the highest height), but the code actually returns heights[len(heights)-1] (the lowest available height).

func (s *BFTSynchronizer) computeTargetHeight(heights []uint64) uint64 {
  // ... 
  if lenH < f+1 {
    s.Logger.Debugf("Returning %d", heights[0])
    return heights[int(lenH)-1]
  }
  // ...
}

Steps to reproduce

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions