diff options
Diffstat (limited to 'vendor/github.com/dexon-foundation/dexon-consensus/core/lattice.go')
-rw-r--r-- | vendor/github.com/dexon-foundation/dexon-consensus/core/lattice.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/lattice.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/lattice.go index d531639b9..de0e54910 100644 --- a/vendor/github.com/dexon-foundation/dexon-consensus/core/lattice.go +++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/lattice.go @@ -290,6 +290,13 @@ func (l *Lattice) NextBlock(round uint64, chainID uint32) ( return l.data.nextBlock(round, chainID) } +// TipRound returns the round of the tip of given chain. +func (l *Lattice) TipRound(chainID uint32) uint64 { + l.lock.RLock() + defer l.lock.RUnlock() + return l.data.tipRound(chainID) +} + // PurgeBlocks purges blocks' cache in memory, this is called when the caller // makes sure those blocks are already saved in db. func (l *Lattice) PurgeBlocks(blocks []*types.Block) error { |