Commit 0a7a0a86bd0077be2dad52bd6df4d248b0ca4a6a
Kernel: simplify contract creation condition
Alex Beregszaszi committed on 8/28/2016, 9:18:55 PMParent: b84b9ce5c6f30045e23b1dafc1bcea2333cbd73f
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -185,14 +185,11 @@ | ||
185 | 185 | |
186 | 186 | let isCreation = false |
187 | 187 | |
188 | 188 | // Special case: contract deployment |
189 | - if (tx.to.isZero()) { | |
190 | - if (tx.data.length !== 0) { | |
191 | - console.log('This is a contract deployment transaction') | |
192 | - | |
193 | - isCreation = true | |
194 | - } | |
189 | + if (tx.to.isZero() && (tx.data.length !== 0)) { | |
190 | + console.log('This is a contract deployment transaction') | |
191 | + isCreation = true | |
195 | 192 | } |
196 | 193 | |
197 | 194 | // This cost will not be refunded |
198 | 195 | let txCost = 21000 + (isCreation ? 32000 : 0) |
Built with git-ssb-web