aboutsummaryrefslogtreecommitdiffstats
path: root/miner
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-12-23 20:48:44 +0800
committerobscuren <geffobscura@gmail.com>2014-12-23 20:48:44 +0800
commit4cd79d8ddd7608d60344b13fe4bda7315429d1d9 (patch)
tree0d1abaa9ef5c302c1ef51e8e8dbd94e9e696f28a /miner
parent4b52cd512d3c54451e680fcc6c3d67d059065bec (diff)
downloaddexon-4cd79d8ddd7608d60344b13fe4bda7315429d1d9.tar
dexon-4cd79d8ddd7608d60344b13fe4bda7315429d1d9.tar.gz
dexon-4cd79d8ddd7608d60344b13fe4bda7315429d1d9.tar.bz2
dexon-4cd79d8ddd7608d60344b13fe4bda7315429d1d9.tar.lz
dexon-4cd79d8ddd7608d60344b13fe4bda7315429d1d9.tar.xz
dexon-4cd79d8ddd7608d60344b13fe4bda7315429d1d9.tar.zst
dexon-4cd79d8ddd7608d60344b13fe4bda7315429d1d9.zip
Refactored block & Transaction
* Includes new rlp decoder
Diffstat (limited to 'miner')
-rw-r--r--miner/miner.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/miner/miner.go b/miner/miner.go
index d909c228b..c9a6922bb 100644
--- a/miner/miner.go
+++ b/miner/miner.go
@@ -56,7 +56,7 @@ type Miner struct {
eth *eth.Ethereum
events event.Subscription
- uncles types.Blocks
+ uncles []*types.Header
localTxs map[int]*LocalTx
localTxId int
@@ -184,9 +184,9 @@ func (self *Miner) mine() {
block.SetUncles(self.uncles)
}
- parent := chainMan.GetBlock(block.PrevHash)
- coinbase := block.State().GetOrNewStateObject(block.Coinbase)
- coinbase.SetGasPool(block.CalcGasLimit(parent))
+ parent := chainMan.GetBlock(block.ParentHash())
+ coinbase := block.State().GetOrNewStateObject(block.Coinbase())
+ coinbase.SetGasPool(core.CalcGasLimit(parent, block))
transactions := self.finiliseTxs()
@@ -211,7 +211,7 @@ func (self *Miner) mine() {
// Find a valid nonce
nonce := self.pow.Search(block, self.powQuitCh)
if nonce != nil {
- block.Nonce = nonce
+ block.Header().Nonce = nonce
err := chainMan.InsertChain(types.Blocks{block})
if err != nil {
minerlogger.Infoln(err)