From 65158d39b0632226c168b9a3415365ca8f072cbf Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 4 Feb 2015 15:05:47 -0800 Subject: Filtering --- core/block_processor.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'core/block_processor.go') 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, -- cgit v1.2.3