Use MessageIndex in WaitForMessage
This commit is contained in:
parent
84b0a37e08
commit
a29622520a
@ -57,11 +57,16 @@ func (sm *StateManager) WaitForMessage(ctx context.Context, mcid cid.Cid, confid
|
|||||||
var backFm cid.Cid
|
var backFm cid.Cid
|
||||||
backSearchWait := make(chan struct{})
|
backSearchWait := make(chan struct{})
|
||||||
go func() {
|
go func() {
|
||||||
fts, r, foundMsg, err := sm.searchBackForMsg(ctx, head[0].Val, msg, lookbackLimit, allowReplaced)
|
fts, r, foundMsg, err := sm.searchForIndexedMsg(ctx, mcid, msg)
|
||||||
|
|
||||||
|
found := (err == nil && r != nil && foundMsg.Defined())
|
||||||
|
if !found {
|
||||||
|
fts, r, foundMsg, err = sm.searchBackForMsg(ctx, head[0].Val, msg, lookbackLimit, allowReplaced)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warnf("failed to look back through chain for message: %v", err)
|
log.Warnf("failed to look back through chain for message: %v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
backTs = fts
|
backTs = fts
|
||||||
backRcp = r
|
backRcp = r
|
||||||
|
Loading…
Reference in New Issue
Block a user