MCPcopy Create free account
hub / github.com/DNAProject/DNA / Commit

Method Commit

smartcontract/storage/cachedb.go:70–78  ·  view source on GitHub ↗

Commit current transaction cache to block cache

()

Source from the content-addressed store, hash-verified

68
69// Commit current transaction cache to block cache
70func (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
80func (self *CacheDB) Put(key []byte, value []byte) {
81 self.put(common.ST_STORAGE, key, value)

Callers 3

TestCacheDBFunction · 0.95

Calls 3

ForEachMethod · 0.80
DeleteMethod · 0.65
PutMethod · 0.65

Tested by 1

TestCacheDBFunction · 0.76