Преглед на файлове

ethdb/memorydb: allow noop compact on memdb (#19907)

* ethdb/memorydb: allow noop compact on memdb

* ethdb/memorydb: fix comment type
Péter Szilágyi преди 6 години
родител
ревизия
e46a01d56c
променени са 1 файла, в които са добавени 3 реда и са изтрити 2 реда
  1. 3 2
      ethdb/memorydb/memorydb.go

+ 3 - 2
ethdb/memorydb/memorydb.go

@@ -197,9 +197,10 @@ func (db *Database) Stat(property string) (string, error) {
 	return "", errors.New("unknown property")
 }
 
-// Compact is not supported on a memory database.
+// Compact is not supported on a memory database, but there's no need either as
+// a memory database doesn't waste space anyway.
 func (db *Database) Compact(start []byte, limit []byte) error {
-	return errors.New("unsupported operation")
+	return nil
 }
 
 // Len returns the number of entries currently present in the memory database.