Use View instead of Update in NewBlockchain()

This commit is contained in:
Wei Yang 2017-10-18 11:51:41 +08:00
parent 42b9dbb26e
commit 8ea4bc859d
1 changed files with 1 additions and 1 deletions

View File

@ -82,7 +82,7 @@ func NewBlockchain(nodeID string) *Blockchain {
log.Panic(err) log.Panic(err)
} }
err = db.Update(func(tx *bolt.Tx) error { err = db.View(func(tx *bolt.Tx) error {
b := tx.Bucket([]byte(blocksBucket)) b := tx.Bucket([]byte(blocksBucket))
tip = b.Get([]byte("l")) tip = b.Get([]byte("l"))