Commit current transaction cache to block cache
()
| 68 | |
| 69 | // Commit current transaction cache to block cache |
| 70 | func (self *CacheDB) Commit() { |
| 71 | self.memdb.ForEach(func(key, val []byte) { |
| 72 | if len(val) == 0 { |
| 73 | self.backend.Delete(key) |
| 74 | } else { |
| 75 | self.backend.Put(key, val) |
| 76 | } |
| 77 | }) |
| 78 | } |
| 79 | |
| 80 | func (self *CacheDB) Put(key []byte, value []byte) { |
| 81 | self.put(common.ST_STORAGE, key, value) |