Skip to content

Commit

Permalink
read state of replica
Browse files Browse the repository at this point in the history
  • Loading branch information
roynalnaruto committed Aug 7, 2020
1 parent 52050f9 commit e534a27
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions replica/replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,12 @@ func (replica *Replica) UpdateState(height process.Height, round process.Round,
WithCurrentStep(step)
}

// State returns the current height, round and step of the replica's underlying
// process
func (replica Replica) State() (process.Height, process.Round, process.Step) {
return replica.proc.CurrentHeight, replica.proc.CurrentRound, replica.proc.CurrentStep
}

// CurrentHeight returns the height (in terms of block number) that the replica
// is currently at
func (replica Replica) CurrentHeight() process.Height {
Expand Down

0 comments on commit e534a27

Please sign in to comment.