github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/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 }