diff --git a/nimbus/db/core_db/base.nim b/nimbus/db/core_db/base.nim index 64483d7a5..28e60a760 100644 --- a/nimbus/db/core_db/base.nim +++ b/nimbus/db/core_db/base.nim @@ -479,9 +479,9 @@ proc state*(col: CoreDbColRef): CoreDbRc[Hash256] = # Note: tracker will be silent if `vid` is NIL col.ifTrackNewApi: debug newApiTxt, api, elapsed, col, result -proc stateOrVoid*(col: CoreDbColRef): Hash256 = - ## Convenience wrapper, returns `EMPTY_ROOT_HASH` where `state()` would fail. - col.state.valueOr: EMPTY_ROOT_HASH +proc stateEmptyOrVoid*(col: CoreDbColRef): bool = + ## Convenience wrapper, returns `true` where `stateEmpty()` would fail. + col.stateEmpty.valueOr: true # ------------------------------------------------------------------------------ # Public Merkle Patricia Tree, hexary trie constructors diff --git a/nimbus/db/ledger/accounts_ledger.nim b/nimbus/db/ledger/accounts_ledger.nim index cf5f3abca..286aee350 100644 --- a/nimbus/db/ledger/accounts_ledger.nim +++ b/nimbus/db/ledger/accounts_ledger.nim @@ -458,7 +458,7 @@ proc contractCollision*(ac: AccountsLedgerRef, address: EthAddress): bool = return acc.statement.nonce != 0 or acc.statement.codeHash != EMPTY_CODE_HASH or - acc.statement.storage.stateOrVoid != EMPTY_ROOT_HASH + not acc.statement.storage.stateEmptyOrVoid proc accountExists*(ac: AccountsLedgerRef, address: EthAddress): bool = let acc = ac.getAccount(address, false)