From 651d3b83ed3f0b1c3bec4164a96d87bca8eaefaf Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 30 Nov 2016 13:30:47 +0000 Subject: [PATCH] Support deterministically changing coinbase/difficulty/blockGasLimit on every block --- src/app/txRunner.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/app/txRunner.js b/src/app/txRunner.js index 7b2aedeab3..2a6ee14908 100644 --- a/src/app/txRunner.js +++ b/src/app/txRunner.js @@ -97,11 +97,16 @@ TxRunner.prototype.execute = function () { data: new Buffer(data.slice(2), 'hex') }) tx.sign(account.privateKey) + + const coinbases = [ '0x0e9281e9c6a0808672eaba6bd1220e144c9bb07a', '0x8945a1288dc78a6d8952a92c77aee6730b414778', '0x94d76e24f818426ae84aa404140e8d5f60e10e7e' ] + const difficulties = [ new BN('69762765929000', 10), new BN('70762765929000', 10), new BN('71762765929000', 10) ] var block = new EthJSBlock({ header: { - // FIXME: support coinbase, difficulty and gasLimit timestamp: new Date().getTime() / 1000 | 0, - number: self.blockNumber + number: self.blockNumber, + coinbase: coinbases[self.blockNumber % coinbases.length], + difficulty: difficulties[self.blockNumber % difficulties.length], + gasLimit: new BN(gasLimit, 10).imuln(2) }, transactions: [], uncleHeaders: []