fix misuse of sled transactions

This commit is contained in:
Alex Auvolat 2021-02-23 22:45:36 +01:00
parent 20e6e9fa20
commit a52ab69640

View file

@ -431,7 +431,7 @@ where
pub(crate) fn delete_if_equal(self: &Arc<Self>, k: &[u8], v: &[u8]) -> Result<bool, Error> {
let removed = self.store.transaction(|txn| {
if let Some(cur_v) = self.store.get(k)? {
if let Some(cur_v) = txn.get(k)? {
if cur_v == v {
txn.remove(v)?;
return Ok(true);