Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.keyExists(key, function(err, exists) {
if (err) {
return callback(err);
}
if (exists) {
// TODO: just because we have the key doesn't mean we're at the right
// block number/root to send it. We need to check the block number
// before using the data in our own trie.
MerklePatriciaTree.prototype.get.call(self, key, function(err, r) {
callback(err, r);
});
} else {
self.keyIsDeleted(key, (err, deleted) => {
if (err) {
return callback(err);
}
if (deleted) {
// it was deleted. return nothing.
callback(null, Buffer.allocUnsafe(0));
return;
}
// If this is the main trie, get the whole account.
if (self.address == null) {