aboutsummaryrefslogtreecommitdiffstats
path: root/ethdb/memory_database.go
diff options
context:
space:
mode:
authorgary rong <garyrong0905@gmail.com>2017-08-11 18:41:49 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-08-11 18:41:49 +0800
commit73c5aba21fcca1bf1f78e94d88920fde6762be9e (patch)
tree551324966298ee0462ff39b378925aea3597eccb /ethdb/memory_database.go
parent17ce0a37de5a2712a8bf9d58df705e718b3b2cd6 (diff)
downloaddexon-73c5aba21fcca1bf1f78e94d88920fde6762be9e.tar
dexon-73c5aba21fcca1bf1f78e94d88920fde6762be9e.tar.gz
dexon-73c5aba21fcca1bf1f78e94d88920fde6762be9e.tar.bz2
dexon-73c5aba21fcca1bf1f78e94d88920fde6762be9e.tar.lz
dexon-73c5aba21fcca1bf1f78e94d88920fde6762be9e.tar.xz
dexon-73c5aba21fcca1bf1f78e94d88920fde6762be9e.tar.zst
dexon-73c5aba21fcca1bf1f78e94d88920fde6762be9e.zip
ethdb: return copied value from MemDatabase.Get (#14958)
Diffstat (limited to 'ethdb/memory_database.go')
-rw-r--r--ethdb/memory_database.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/ethdb/memory_database.go b/ethdb/memory_database.go
index a2ee2f2cc..11b093724 100644
--- a/ethdb/memory_database.go
+++ b/ethdb/memory_database.go
@@ -50,7 +50,7 @@ func (db *MemDatabase) Get(key []byte) ([]byte, error) {
defer db.lock.RUnlock()
if entry, ok := db.db[string(key)]; ok {
- return entry, nil
+ return common.CopyBytes(entry), nil
}
return nil, errors.New("not found")
}