aboutsummaryrefslogtreecommitdiffstats
path: root/trie/cache.go
diff options
context:
space:
mode:
Diffstat (limited to 'trie/cache.go')
-rw-r--r--trie/cache.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/trie/cache.go b/trie/cache.go
index 2143785fa..4c76c6cba 100644
--- a/trie/cache.go
+++ b/trie/cache.go
@@ -1,8 +1,10 @@
package trie
+import "github.com/ethereum/go-ethereum/logger/glog"
+
type Backend interface {
Get([]byte) ([]byte, error)
- Put([]byte, []byte)
+ Put([]byte, []byte) error
}
type Cache struct {
@@ -29,7 +31,9 @@ func (self *Cache) Put(key []byte, data []byte) {
func (self *Cache) Flush() {
for k, v := range self.store {
- self.backend.Put([]byte(k), v)
+ if err := self.backend.Put([]byte(k), v); err != nil {
+ glog.Fatal("db write err:", err)
+ }
}
// This will eventually grow too large. We'd could