Commit 9b5545940cea05703845fc350781ee577ca2e326
Kernel: only do metering if it is a WASM code
Alex Beregszaszi committed on 8/26/2016, 9:40:45 PMParent: 1039324df6ed695b396944c8d6f5f4157f3bf6ce
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -125,10 +125,14 @@ | ||
125 | 125 | } |
126 | 126 | } |
127 | 127 | |
128 | 128 | createHandler (create) { |
129 | + let code = create.data | |
130 | + | |
129 | 131 | // Inject metering |
130 | - const code = this.callHandler({ to: meteringContract, data: code }).returnValue | |
132 | + if (Utils.isWASMCode(code)) { | |
133 | + code = this.callHandler({ to: meteringContract, data: code }).returnValue | |
134 | + } | |
131 | 135 | |
132 | 136 | let address = Utils.newAccountAddress(create.from, code) |
133 | 137 | |
134 | 138 | this.environment.addAccount(address.toString(), { |
Built with git-ssb-web