mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 17:33:47 +00:00
ethdb/memorydb: add errMemorydbClosed check
Co-authored-by: Martin HS <martin@swende.se>
This commit is contained in:
parent
9aadac61be
commit
7261d0bea3
1 changed files with 3 additions and 0 deletions
|
|
@ -126,6 +126,9 @@ func (db *Database) Delete(key []byte) error {
|
|||
func (db *Database) DeleteRange(start, end []byte) error {
|
||||
db.lock.Lock()
|
||||
defer db.lock.Unlock()
|
||||
if db.db == nil {
|
||||
return errMemorydbClosed
|
||||
}
|
||||
|
||||
for key := range db.db {
|
||||
if key >= string(start) && key < string(end) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue