citahub / cita_trie

Rust implementation of the Modified Patricia Tree (aka Trie).
Apache License 2.0
71 stars 28 forks source link

fix(trie): delete nonexistent keys from DB #10

Closed yejiayu closed 5 years ago

u2 commented 5 years ago

So this PR fixed two bugs? firstly, fixed the delete operation of the nonexistent keys; secondly, fixed the delete keys in DB.

yejiayu commented 5 years ago

Only fixed one, delete a node that does not exist from the database when calling commit

u2 commented 5 years ago
        for key in self.deleted_keys.drain(..) {
            self.db.remove(key.as_ref()).map_err(TrieError::DB)?;
        }

I think not just one. Maybe I misunderstood it.