diff options
author | obscuren <geffobscura@gmail.com> | 2014-05-20 21:02:46 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-05-20 21:02:46 +0800 |
commit | 2bd377a3de54652923558b63cc8756531269e36e (patch) | |
tree | 070e258a4e82948c6dad0c2ce7468dd20f932b88 /ethchain/block_chain.go | |
parent | 7d3e99a2abcef6011714a7e6e515aa8e2bc738cc (diff) | |
download | dexon-2bd377a3de54652923558b63cc8756531269e36e.tar.gz dexon-2bd377a3de54652923558b63cc8756531269e36e.tar.zst dexon-2bd377a3de54652923558b63cc8756531269e36e.zip |
Changed transaction hash for poc 5
Diffstat (limited to 'ethchain/block_chain.go')
-rw-r--r-- | ethchain/block_chain.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ethchain/block_chain.go b/ethchain/block_chain.go index eb25bd3f4..2865336fb 100644 --- a/ethchain/block_chain.go +++ b/ethchain/block_chain.go @@ -70,6 +70,22 @@ func (bc *BlockChain) NewBlock(coinbase []byte, txs []*Transaction) *Block { diff.Mul(diff, mul) diff.Add(diff, bc.CurrentBlock.Difficulty) block.Difficulty = diff + + block.Number = new(big.Int).Add(bc.CurrentBlock.Number, ethutil.Big1) + + // max(10000, (parent gas limit * (1024 - 1) + (parent gas used * 6 / 5)) / 1024) + base := new(big.Int) + base2 := new(big.Int) + parentGL := bc.CurrentBlock.GasLimit + parentUsed := bc.CurrentBlock.GasUsed + + base.Mul(parentGL, big.NewInt(1024-1)) + base2.Mul(parentUsed, big.NewInt(6)) + base2.Div(base2, big.NewInt(5)) + base.Add(base, base2) + base.Div(base, big.NewInt(1024)) + + block.GasLimit = ethutil.BigMax(big.NewInt(10000), base) } return block |