Merge pull request #1301 from molecula/fix-rbf-cursor-close

This commit is contained in:
Ben Johnson 2021-01-07 19:22:34 -07:00 committed by GitHub
commit 1865de8248
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1388,7 +1388,10 @@ func (c *Cursor) difference(key uint64, data *roaring.Container) (bool, error) {
func (c *Cursor) Close() {
if c == nil {
panic("cannot Close nil Cursor")
} else if c.tx == nil || c.tx.db == nil {
return // already closed
}
tx := c.tx
c.tx = nil // allow tx to be garbage collected.