stmgr: Fix WaitMessage with more than one msg from single origin

This commit is contained in:
Łukasz Magiera 2019-11-24 23:42:51 +01:00
parent 3cf97c4278
commit 67b22ac22e
2 changed files with 5 additions and 8 deletions

View File

@ -1,7 +0,0 @@
package chain
import "testing"
func TestMessagePool(t *testing.T) {
}

View File

@ -483,7 +483,11 @@ func (sm *StateManager) tipsetExecutedMessage(ts *types.TipSet, msg cid.Cid, vmm
return nil, err
}
for i, m := range cm {
for ii := range cm {
// iterate in reverse because we going backwards through the chain
i := len(cm) - ii - 1
m := cm[i]
if m.VMMessage().From == vmm.From { // cheaper to just check origin first
if m.VMMessage().Nonce == vmm.Nonce {
if m.Cid() == msg {