mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-12 13:24:21 +00:00
cleanup: replace unnecessary initHexaryTrie with emptyRlpHash
it's simple non-sense
This commit is contained in:
parent
e1abf81cac
commit
f0a0c1b878
@ -1,16 +1,14 @@
|
|||||||
import
|
import
|
||||||
std/tables,
|
std/tables,
|
||||||
eth/[common, rlp, trie, p2p],
|
eth/[common, rlp, trie, p2p],
|
||||||
chronicles, eth/trie/db,
|
chronicles, eth/trie/[db, trie_defs],
|
||||||
./db/[db_chain, state_db],
|
./db/[db_chain, state_db],
|
||||||
./constants,
|
"."/[constants, chain_config, forks, p2p/gaslimit]
|
||||||
./chain_config, ./forks, ./p2p/gaslimit
|
|
||||||
|
|
||||||
proc toBlock*(g: Genesis, db: BaseChainDB = nil): BlockHeader =
|
proc toBlock*(g: Genesis, db: BaseChainDB = nil): BlockHeader =
|
||||||
let (tdb, pruneTrie) = if db.isNil: (newMemoryDB(), true)
|
let (tdb, pruneTrie) = if db.isNil: (newMemoryDB(), true)
|
||||||
else: (db.db, db.pruneTrie)
|
else: (db.db, db.pruneTrie)
|
||||||
var trie = initHexaryTrie(tdb)
|
var sdb = newAccountStateDB(tdb, emptyRlpHash, pruneTrie)
|
||||||
var sdb = newAccountStateDB(tdb, trie.rootHash, pruneTrie)
|
|
||||||
|
|
||||||
for address, account in g.alloc:
|
for address, account in g.alloc:
|
||||||
sdb.setAccount(address, newAccount(account.nonce, account.balance))
|
sdb.setAccount(address, newAccount(account.nonce, account.balance))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user