Commit cc158647093a8f0b73c2ae1c9b2dfc688096b36d
Kernel: do account lookup properly in callHandler
Alex Beregszaszi committed on 8/23/2016, 12:27:46 AMParent: 266c548319506a78abb4cfc115fb492fd6628782
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -61,14 +61,14 @@ | ||
61 | 61 | // Detects if code is EVM or WASM |
62 | 62 | // Detects if the code injection is needed |
63 | 63 | // Detects if transcompilation is needed |
64 | 64 | 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) { | |
67 | 67 | throw new Error('Account not found') |
68 | 68 | } |
69 | 69 | |
70 | - const code = this.environment.state.get(address) | |
70 | + const code = this.environment.state.get(account.codeHash) | |
71 | 71 | |
72 | 72 | if (!code) { |
73 | 73 | throw new Error('Contract not found') |
74 | 74 | } |
Built with git-ssb-web