OSDN Git Service

fix_ended_instance (#2111)
[bytom/bytom.git] / protocol / protocol.go
index 7aed23a..f1429be 100644 (file)
@@ -145,6 +145,11 @@ func (c *Chain) BestChain() (uint64, bc.Hash) {
        return c.bestBlockHeader.Height, c.bestBlockHeader.Hash()
 }
 
+func (c *Chain) FinalizedHeight() uint64 {
+       finalizedHeight, _ := c.casper.LastFinalized()
+       return finalizedHeight
+}
+
 // AllValidators return all validators has vote num
 func (c *Chain) AllValidators(blockHash *bc.Hash) ([]*state.Validator, error) {
        parentCheckpoint, err := c.casper.ParentCheckpoint(blockHash)