Merge pull request #10587 from filecoin-project/10583-enable-index-for-statewaitformessage
feat: Use MessageIndex in WaitForMessage
This commit is contained in:
commit
36913db0cd
@ -57,10 +57,15 @@ 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)
|
||||||
if err != nil {
|
|
||||||
log.Warnf("failed to look back through chain for message: %v", err)
|
found := (err == nil && r != nil && foundMsg.Defined())
|
||||||
return
|
if !found {
|
||||||
|
fts, r, foundMsg, err = sm.searchBackForMsg(ctx, head[0].Val, msg, lookbackLimit, allowReplaced)
|
||||||
|
if err != nil {
|
||||||
|
log.Warnf("failed to look back through chain for message: %v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
backTs = fts
|
backTs = fts
|
||||||
|
Loading…
Reference in New Issue
Block a user