From 7ed2403c5c6abb2c3179b856c3786683fa08f31a Mon Sep 17 00:00:00 2001 From: coffeepots Date: Mon, 3 Sep 2018 19:24:55 +0100 Subject: [PATCH] Add hasCodeOrNonce --- nimbus/db/state_db.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nimbus/db/state_db.nim b/nimbus/db/state_db.nim index 915a3a941..fefaf70b8 100644 --- a/nimbus/db/state_db.nim +++ b/nimbus/db/state_db.nim @@ -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 \ No newline at end of file