mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
swarm/storage: fixed comment and improved error. cleandb no longer exists
This commit is contained in:
parent
f03c58336b
commit
a1b2b4c5b6
1 changed files with 3 additions and 3 deletions
|
|
@ -662,7 +662,7 @@ func (s *LDBStore) tryAccessIdx(ikey []byte, index *dpaDBIndex) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *LDBStore) Get(key Key) (chunk *Chunk, err error) {
|
func (s *LDBStore) Get(key Key) (chunk *Chunk, err error) {
|
||||||
//log.Trace("ldbstore.get", "key", chunk.Key) - seems like chunk is nil sometimes
|
log.Trace("ldbstore.get", "key", key)
|
||||||
s.lock.Lock()
|
s.lock.Lock()
|
||||||
defer s.lock.Unlock()
|
defer s.lock.Unlock()
|
||||||
return s.get(key)
|
return s.get(key)
|
||||||
|
|
@ -700,9 +700,9 @@ func (s *LDBStore) get(key Key) (chunk *Chunk, err error) {
|
||||||
hash := hasher.Sum(nil)
|
hash := hasher.Sum(nil)
|
||||||
|
|
||||||
if !bytes.Equal(hash, key) {
|
if !bytes.Equal(hash, key) {
|
||||||
log.Error(fmt.Sprintf("Apparent key/hash mismatch. Hash %x, key %v", hash, key[:]))
|
log.Error("apparent key/hash mismatch", "hash", hash, "key", key[:])
|
||||||
s.delete(indx.Idx, getIndexKey(key), s.po(key))
|
s.delete(indx.Idx, getIndexKey(key), s.po(key))
|
||||||
log.Error("Invalid Chunk in Database. Please repair with command: 'swarm cleandb'")
|
log.Error("invalid chunk in database.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue