Merge pull request #2192 from filecoin-project/fix/evnts-map-pnc
Fix concurrent map access panic in event API
This commit is contained in:
commit
92f392d422
@ -443,8 +443,8 @@ func (we *watcherEvents) StateChanged(check CheckFunc, scHnd StateChangeHandler,
|
|||||||
}
|
}
|
||||||
|
|
||||||
we.lk.Lock()
|
we.lk.Lock()
|
||||||
we.matchers[id] = mf
|
|
||||||
defer we.lk.Unlock()
|
defer we.lk.Unlock()
|
||||||
|
we.matchers[id] = mf
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -476,10 +476,11 @@ func (me *messageEvents) checkNewCalls(ts *types.TipSet) (map[triggerID]eventDat
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
res := make(map[triggerID]eventData)
|
|
||||||
me.messagesForTs(pts, func(msg *types.Message) {
|
|
||||||
me.lk.RLock()
|
me.lk.RLock()
|
||||||
defer me.lk.RUnlock()
|
defer me.lk.RUnlock()
|
||||||
|
|
||||||
|
res := make(map[triggerID]eventData)
|
||||||
|
me.messagesForTs(pts, func(msg *types.Message) {
|
||||||
// TODO: provide receipts
|
// TODO: provide receipts
|
||||||
|
|
||||||
for tid, matchFns := range me.matchers {
|
for tid, matchFns := range me.matchers {
|
||||||
|
Loading…
Reference in New Issue
Block a user