fix rpc/p2p.nim

This commit is contained in:
jangko 2020-06-22 10:10:12 +07:00
parent f401622782
commit 438ad832cc
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
1 changed files with 3 additions and 4 deletions

View File

@ -86,11 +86,10 @@ proc binarySearchGas(vmState: var BaseVMState, transaction: Transaction, sender:
proc setupEthRpc*(node: EthereumNode, chain: BaseChainDB, rpcsrv: RpcServer) =
func getAccountDb(header: BlockHeader): ReadOnlyStateDB =
proc getAccountDb(header: BlockHeader): ReadOnlyStateDB =
## Retrieves the account db from canonical head
# TODO: header.stateRoot to prevStateRoot
let vmState = newBaseVMState(header.stateRoot, header, chain)
result = vmState.readOnlyStateDB()
let ac = AccountsCache.init(chain.db, header.stateRoot, chain.pruneTrie)
result = ReadOnlyStateDB(ac)
proc accountDbFromTag(tag: string, readOnly = true): ReadOnlyStateDB =
result = getAccountDb(chain.headerFromTag(tag))