Add hasCodeOrNonce

This commit is contained in:
coffeepots 2018-09-03 19:24:55 +01:00
parent e1bc482f39
commit 7ed2403c5c
1 changed files with 2 additions and 0 deletions

View File

@ -133,3 +133,5 @@ proc getCode*(db: AccountStateDB, address: EthAddress): ByteRange =
let codeHash = db.getCodeHash(address)
result = db.trie.get(codeHash.toByteRange_Unnecessary)
proc hasCodeOrNonce*(account: AccountStateDB, address: EthAddress): bool {.inline.} =
account.getNonce(address) != 0 or account.getCodeHash(address) != EMPTY_SHA3