diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-06-22 07:49:14 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-06-22 07:49:14 +0800 |
commit | 7633dfdc082e8a692ba8089732d353ad31b0a0d6 (patch) | |
tree | 362ea86e1edf2228fe750725d4703bf4512d6c9e /ethdb | |
parent | 3deded28a50398b8ce108c72f27ea861c1bce178 (diff) | |
parent | a40a91d60f978477fd2582487dfb5e83d4255bf4 (diff) | |
download | go-tangerine-7633dfdc082e8a692ba8089732d353ad31b0a0d6.tar go-tangerine-7633dfdc082e8a692ba8089732d353ad31b0a0d6.tar.gz go-tangerine-7633dfdc082e8a692ba8089732d353ad31b0a0d6.tar.bz2 go-tangerine-7633dfdc082e8a692ba8089732d353ad31b0a0d6.tar.lz go-tangerine-7633dfdc082e8a692ba8089732d353ad31b0a0d6.tar.xz go-tangerine-7633dfdc082e8a692ba8089732d353ad31b0a0d6.tar.zst go-tangerine-7633dfdc082e8a692ba8089732d353ad31b0a0d6.zip |
Merge pull request #1305 from obscuren/database-error-check
core, ethdb, trie: validate database errors
Diffstat (limited to 'ethdb')
-rw-r--r-- | ethdb/database.go | 4 | ||||
-rw-r--r-- | ethdb/memory_database.go | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/ethdb/database.go b/ethdb/database.go index 019645ced..5faf8c4e0 100644 --- a/ethdb/database.go +++ b/ethdb/database.go @@ -42,8 +42,8 @@ func NewLDBDatabase(file string) (*LDBDatabase, error) { } // Put puts the given key / value to the queue -func (self *LDBDatabase) Put(key []byte, value []byte) { - self.db.Put(key, rle.Compress(value), nil) +func (self *LDBDatabase) Put(key []byte, value []byte) error { + return self.db.Put(key, rle.Compress(value), nil) } // Get returns the given key if it's present. diff --git a/ethdb/memory_database.go b/ethdb/memory_database.go index f5d5faee7..c15c56bfb 100644 --- a/ethdb/memory_database.go +++ b/ethdb/memory_database.go @@ -19,8 +19,10 @@ func NewMemDatabase() (*MemDatabase, error) { return db, nil } -func (db *MemDatabase) Put(key []byte, value []byte) { +func (db *MemDatabase) Put(key []byte, value []byte) error { db.db[string(key)] = value + + return nil } func (db *MemDatabase) Set(key []byte, value []byte) { |