Use View instead of Update in NewBlockchain()
This commit is contained in:
parent
42b9dbb26e
commit
8ea4bc859d
|
@ -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"))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue