🎨 Sync repo

This commit is contained in:
Liang Ding 2022-06-30 22:40:43 +08:00
parent 3d71a2644b
commit eaa83998a4
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
6 changed files with 86 additions and 81 deletions

View file

@ -217,13 +217,14 @@ func AutoFlushBlockTree() {
}
}
func ReadBlockTree() (err error) {
func InitBlockTree() {
start := time.Now()
if nil == blocktreeFileLock {
blocktreeFileLock = flock.New(util.BlockTreePath)
}
var err error
if err = blocktreeFileLock.Lock(); nil != err {
util.LogErrorf("read block tree failed: %s", err)
os.Exit(util.ExitCodeBlockTreeErr)