diff options
author | obscuren <geffobscura@gmail.com> | 2015-02-06 03:55:03 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-02-06 03:55:03 +0800 |
commit | c64852dbccd0c8eb57cab994aefd0243c65b351b (patch) | |
tree | 84104fd5d12afbd0c3f53311d9b000d22e8935c3 /core | |
parent | bcacaaa4f418d51751cd841a22a8455b165f2375 (diff) | |
download | dexon-c64852dbccd0c8eb57cab994aefd0243c65b351b.tar.gz dexon-c64852dbccd0c8eb57cab994aefd0243c65b351b.tar.zst dexon-c64852dbccd0c8eb57cab994aefd0243c65b351b.zip |
pending / chain event
Diffstat (limited to 'core')
-rw-r--r-- | core/block_processor.go | 8 | ||||
-rw-r--r-- | core/filter.go | 5 |
2 files changed, 11 insertions, 2 deletions
diff --git a/core/block_processor.go b/core/block_processor.go index d59d7feca..349de85e0 100644 --- a/core/block_processor.go +++ b/core/block_processor.go @@ -19,6 +19,10 @@ import ( "gopkg.in/fatih/set.v0" ) +type PendingBlockEvent struct { + Block *types.Block +} + var statelogger = logger.NewLogger("BLOCK") type EthManager interface { @@ -154,6 +158,10 @@ done: block.Reward = cumulativeSum block.Header().GasUsed = totalUsedGas + if transientProcess { + go self.eventMux.Post(PendingBlockEvent{block}) + } + return receipts, handled, unhandled, erroneous, err } diff --git a/core/filter.go b/core/filter.go index c22996d7e..24d1f5a4a 100644 --- a/core/filter.go +++ b/core/filter.go @@ -33,8 +33,9 @@ type Filter struct { max int topics [][]byte - BlockCallback func(*types.Block) - LogsCallback func(state.Logs) + BlockCallback func(*types.Block) + PendingCallback func(*types.Block) + LogsCallback func(state.Logs) } // Create a new filter which uses a bloom filter on blocks to figure out whether a particular block |