Hold tipset lock while selecting messages
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
parent
927f355001
commit
05c527b681
@ -30,13 +30,12 @@ type msgChain struct {
|
|||||||
|
|
||||||
func (mp *MessagePool) SelectMessages(ts *types.TipSet) ([]*types.SignedMessage, error) {
|
func (mp *MessagePool) SelectMessages(ts *types.TipSet) ([]*types.SignedMessage, error) {
|
||||||
mp.curTsLk.Lock()
|
mp.curTsLk.Lock()
|
||||||
curTs := mp.curTs
|
defer mp.curTsLk.Unlock()
|
||||||
mp.curTsLk.Unlock()
|
|
||||||
|
|
||||||
mp.lk.Lock()
|
mp.lk.Lock()
|
||||||
defer mp.lk.Unlock()
|
defer mp.lk.Unlock()
|
||||||
|
|
||||||
return mp.selectMessages(curTs, ts)
|
return mp.selectMessages(mp.curTs, ts)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (mp *MessagePool) selectMessages(curTs, ts *types.TipSet) ([]*types.SignedMessage, error) {
|
func (mp *MessagePool) selectMessages(curTs, ts *types.TipSet) ([]*types.SignedMessage, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user