git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit cc158647093a8f0b73c2ae1c9b2dfc688096b36d

Kernel: do account lookup properly in callHandler

Alex Beregszaszi committed on 8/23/2016, 12:27:46 AM
Parent: 266c548319506a78abb4cfc115fb492fd6628782

Files changed

index.jschanged
index.jsView
@@ -61,14 +61,14 @@
6161 // Detects if code is EVM or WASM
6262 // Detects if the code injection is needed
6363 // Detects if transcompilation is needed
6464 callHandler (address, gaslimit, gasprice, value, data) {
65- var toAccount = this.environment.state.get(new Uint8Array(address).toString())
66- if (!toAccount) {
65+ var account = this.environment.state.get(new Uint8Array(address).toString())
66+ if (!account) {
6767 throw new Error('Account not found')
6868 }
6969
70- const code = this.environment.state.get(address)
70+ const code = this.environment.state.get(account.codeHash)
7171
7272 if (!code) {
7373 throw new Error('Contract not found')
7474 }

Built with git-ssb-web