github.com/okex/exchain@v1.8.0/libs/tendermint/global/height.go (about)

     1  package global
     2  
     3  import "sync/atomic"
     4  
     5  var lastCommittedHeight int64
     6  
     7  // SetGlobalHeight sets lastCommittedHeight safely.
     8  func SetGlobalHeight(height int64) {
     9  	atomic.StoreInt64(&lastCommittedHeight, height)
    10  }
    11  
    12  // GetGlobalHeight gets lastCommittedHeight safely.
    13  func GetGlobalHeight() int64 {
    14  	return atomic.LoadInt64(&lastCommittedHeight)
    15  }