diff options
author | obscuren <geffobscura@gmail.com> | 2015-02-14 00:23:18 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-02-14 00:23:18 +0800 |
commit | 00fca409398172811e71158e0ca9f6229e0f815b (patch) | |
tree | 8f7dc62676e519236b69a977c7af00d81b1e0406 /core | |
parent | 5c251b69282b3992512d0c17ed0063f294a0e663 (diff) | |
parent | 8a0f23915e4feb9aabe21bd075416bc0f32bbc43 (diff) | |
download | dexon-00fca409398172811e71158e0ca9f6229e0f815b.tar dexon-00fca409398172811e71158e0ca9f6229e0f815b.tar.gz dexon-00fca409398172811e71158e0ca9f6229e0f815b.tar.bz2 dexon-00fca409398172811e71158e0ca9f6229e0f815b.tar.lz dexon-00fca409398172811e71158e0ca9f6229e0f815b.tar.xz dexon-00fca409398172811e71158e0ca9f6229e0f815b.tar.zst dexon-00fca409398172811e71158e0ca9f6229e0f815b.zip |
Merge branch 'miner' into develop
Diffstat (limited to 'core')
-rw-r--r-- | core/block_processor.go | 5 | ||||
-rw-r--r-- | core/chain_manager.go | 11 |
2 files changed, 13 insertions, 3 deletions
diff --git a/core/block_processor.go b/core/block_processor.go index c360273da..893c586dd 100644 --- a/core/block_processor.go +++ b/core/block_processor.go @@ -48,8 +48,9 @@ type BlockProcessor struct { func NewBlockProcessor(db ethutil.Database, txpool *TxPool, chainManager *ChainManager, eventMux *event.TypeMux) *BlockProcessor { sm := &BlockProcessor{ - db: db, - mem: make(map[string]*big.Int), + db: db, + mem: make(map[string]*big.Int), + //Pow: ðash.Ethash{}, Pow: ezp.New(), bc: chainManager, eventMux: eventMux, diff --git a/core/chain_manager.go b/core/chain_manager.go index 0847980ca..308e958fe 100644 --- a/core/chain_manager.go +++ b/core/chain_manager.go @@ -16,6 +16,11 @@ import ( var chainlogger = logger.NewLogger("CHAIN") +type ChainEvent struct { + Block *types.Block + Td *big.Int +} + type StateQuery interface { GetAccount(addr []byte) *state.StateObject } @@ -175,6 +180,9 @@ func (bc *ChainManager) NewBlock(coinbase []byte) *types.Block { ethutil.BigPow(2, 32), nil, "") + block.SetUncles(nil) + block.SetTransactions(nil) + block.SetReceipts(nil) parent := bc.currentBlock if parent != nil { @@ -385,8 +393,9 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error { self.setTotalDifficulty(td) self.insert(block) self.transState = state.New(cblock.Root(), self.db) //state.New(cblock.Trie().Copy()) - } + self.eventMux.Post(ChainEvent{block, td}) + } } self.mu.Unlock() |