Skip to content

Commit 66d5559

Browse files
committed
Fixed chain event issue
1 parent 82cae27 commit 66d5559

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

core/chain_manager.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,7 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error {
396396
self.mu.Unlock()
397397

398398
if chain {
399-
fmt.Println("POST START")
400-
self.eventMux.Post(ChainEvent{block, td})
401-
fmt.Println("POST END")
399+
go self.eventMux.Post(ChainEvent{block, td})
402400
}
403401

404402
if split {

rpc/packages.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,11 @@ func (self *EthereumApi) NewFilter(args *FilterOptions, reply *interface{}) erro
101101
self.logMut.Lock()
102102
defer self.logMut.Unlock()
103103

104-
if self.logs[id] == nil {
105-
self.logs[id] = &logFilter{timeout: time.Now()}
106-
}
107-
108104
self.logs[id].add(logs...)
109105
}
110106
id = self.filterManager.InstallFilter(filter)
107+
self.logs[id] = &logFilter{timeout: time.Now()}
108+
111109
*reply = id
112110

113111
return nil

0 commit comments

Comments
 (0)