File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,19 @@ export default class Cache {
51
51
}
52
52
}
53
53
54
+ /**
55
+ * Returns true if the key was deleted and thus existed in the cache earlier
56
+ * @param key - trie key to lookup
57
+ */
58
+ keyIsDeleted ( key : Buffer ) : boolean {
59
+ const keyStr = key . toString ( 'hex' )
60
+ const it = this . _cache . find ( keyStr )
61
+ if ( it . node ) {
62
+ return it . value . deleted
63
+ }
64
+ return false
65
+ }
66
+
54
67
/**
55
68
* Looks up address in underlying trie.
56
69
* @param address - Address of account
Original file line number Diff line number Diff line change @@ -494,7 +494,7 @@ export default class DefaultStateManager implements StateManager {
494
494
*/
495
495
async accountExists ( address : Buffer ) : Promise < boolean > {
496
496
const account = await this . _cache . lookup ( address )
497
- if ( account ) {
497
+ if ( account && ! this . _cache . keyIsDeleted ( address ) ) {
498
498
return true
499
499
}
500
500
if ( await this . _cache . _trie . get ( address ) ) {
You can’t perform that action at this time.
0 commit comments