diff options
author | obscuren <geffobscura@gmail.com> | 2015-02-05 07:05:47 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-02-05 07:05:47 +0800 |
commit | 65158d39b0632226c168b9a3415365ca8f072cbf (patch) | |
tree | 9b8bb62fa6b2a056a85a889f7f8609aca0a6f875 /core/block_processor.go | |
parent | b1870631a4829e075eae77064973ef94aa2166b3 (diff) | |
download | dexon-65158d39b0632226c168b9a3415365ca8f072cbf.tar dexon-65158d39b0632226c168b9a3415365ca8f072cbf.tar.gz dexon-65158d39b0632226c168b9a3415365ca8f072cbf.tar.bz2 dexon-65158d39b0632226c168b9a3415365ca8f072cbf.tar.lz dexon-65158d39b0632226c168b9a3415365ca8f072cbf.tar.xz dexon-65158d39b0632226c168b9a3415365ca8f072cbf.tar.zst dexon-65158d39b0632226c168b9a3415365ca8f072cbf.zip |
Filtering
Diffstat (limited to 'core/block_processor.go')
-rw-r--r-- | core/block_processor.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/core/block_processor.go b/core/block_processor.go index 20a651e84..d59d7feca 100644 --- a/core/block_processor.go +++ b/core/block_processor.go @@ -110,6 +110,8 @@ func (self *BlockProcessor) ApplyTransaction(coinbase *state.StateObject, state go self.eventMux.Post(TxPostEvent{tx}) } + go self.eventMux.Post(state.Logs()) + return receipt, txGas, err } @@ -155,25 +157,25 @@ done: return receipts, handled, unhandled, erroneous, err } -func (sm *BlockProcessor) Process(block *types.Block) (td *big.Int, msgs state.Messages, err error) { +func (sm *BlockProcessor) Process(block *types.Block) (td *big.Int, err error) { // Processing a blocks may never happen simultaneously sm.mutex.Lock() defer sm.mutex.Unlock() header := block.Header() if sm.bc.HasBlock(header.Hash()) { - return nil, nil, &KnownBlockError{header.Number, header.Hash()} + return nil, &KnownBlockError{header.Number, header.Hash()} } if !sm.bc.HasBlock(header.ParentHash) { - return nil, nil, ParentError(header.ParentHash) + return nil, ParentError(header.ParentHash) } parent := sm.bc.GetBlock(header.ParentHash) return sm.ProcessWithParent(block, parent) } -func (sm *BlockProcessor) ProcessWithParent(block, parent *types.Block) (td *big.Int, messages state.Messages, err error) { +func (sm *BlockProcessor) ProcessWithParent(block, parent *types.Block) (td *big.Int, err error) { sm.lastAttemptedBlock = block state := state.New(parent.Root(), sm.db) @@ -227,7 +229,6 @@ func (sm *BlockProcessor) ProcessWithParent(block, parent *types.Block) (td *big state.Sync() // Set the block hashes for the current messages state.Manifest().SetHash(block.Hash()) - messages = state.Manifest().Messages // Reset the manifest XXX We need this? state.Manifest().Reset() // Remove transactions from the pool @@ -235,7 +236,7 @@ func (sm *BlockProcessor) ProcessWithParent(block, parent *types.Block) (td *big chainlogger.Infof("processed block #%d (%x...)\n", header.Number, block.Hash()[0:4]) - return td, messages, nil + return td, nil } // Validates the current block. Returns an error if the block was invalid, |