ethdb, core: implement delete for db batch (#17101)
This commit is contained in:
committed by
Péter Szilágyi
parent
fdfd6d3c39
commit
a4a2343cdc
@ -388,6 +388,12 @@ func (b *ldbBatch) Put(key, value []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *ldbBatch) Delete(key []byte) error {
|
||||
b.b.Delete(key)
|
||||
b.size += 1
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *ldbBatch) Write() error {
|
||||
return b.db.Write(b.b, nil)
|
||||
}
|
||||
@ -453,6 +459,10 @@ func (tb *tableBatch) Put(key, value []byte) error {
|
||||
return tb.batch.Put(append([]byte(tb.prefix), key...), value)
|
||||
}
|
||||
|
||||
func (tb *tableBatch) Delete(key []byte) error {
|
||||
return tb.batch.Delete(append([]byte(tb.prefix), key...))
|
||||
}
|
||||
|
||||
func (tb *tableBatch) Write() error {
|
||||
return tb.batch.Write()
|
||||
}
|
||||
|
Reference in New Issue
Block a user