Compare commits

..
2 Commits
Author SHA1 Message Date
roysc e9420ff2b8 Merge pull request #59 from cerc-io/roy/v5-dev
Deregister groupcache on close
2023-05-31 16:24:24 +08:00
roysc c438c158fc Deregister groupcache on close 2023-05-14 02:33:04 +08:00
+3 -2
View File
@@ -278,9 +278,10 @@ func (d *Database) NewIterator(prefix []byte, start []byte) ethdb.Iterator {
return NewIterator(start, prefix, d.db)
}
// Close satisfies the io.Closer interface
// Close closes the db connection
// Close satisfies the io.Closer interface.
// Close closes the db connection and deregisters from groupcache.
func (d *Database) Close() error {
groupcache.DeregisterGroup(d.cache.Name())
return d.db.DB.Close()
}