Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
use put(0) for forked deletion to make sure the key stays in the trie
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeseese committed Sep 22, 2020
1 parent 301872f commit e7e50b8
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions lib/forking/forked_storage_trie.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,8 @@ ForkedStorageBaseTrie.prototype.getTouchedAt = function(key, callback) {
});
};

const originalDelete = ForkedStorageBaseTrie.prototype.del;
ForkedStorageBaseTrie.prototype.del = function(key, callback) {
const self = this;
this.touch(key, function(err) {
if (err) {
return callback(err);
}

originalDelete.call(self, key, callback);
});
this.put(key, 0, callback);
};

ForkedStorageBaseTrie.prototype.copy = function() {
Expand Down

0 comments on commit e7e50b8

Please sign in to comment.