diff --git a/tasks/actorstate/multisig.go b/tasks/actorstate/multisig.go index 33b37e3db..dd7e81863 100644 --- a/tasks/actorstate/multisig.go +++ b/tasks/actorstate/multisig.go @@ -75,8 +75,6 @@ func ExtractMultisigTransactions(a ActorInfo, ec *MsigExtractionContext) (multis return nil, xerrors.Errorf("diffing pending transactions: %w", err) } - log.Debugw("multisig diff", "added", len(changes.Added), "modified", len(changes.Modified), "removed", len(changes.Removed)) - for _, added := range changes.Added { approved := make([]string, len(added.Tx.Approved)) for i, addr := range added.Tx.Approved { diff --git a/tasks/msapprovals/msapprovals.go b/tasks/msapprovals/msapprovals.go index fac353a0e..eda684fce 100644 --- a/tasks/msapprovals/msapprovals.go +++ b/tasks/msapprovals/msapprovals.go @@ -247,7 +247,9 @@ func (p *Task) getTransactionIfApplied(ctx context.Context, msg *types.Message, } // Get state of actor before the message was applied - act, err := p.node.StateGetActor(ctx, msg.To, pts.Key()) + // pts is the tipset containing the messages, so we need the state as seen at the start of message processing + // for that tipset + act, err := p.node.StateGetActor(ctx, msg.To, pts.Parents()) if err != nil { return false, nil, xerrors.Errorf("failed to load previous actor: %w", err) } @@ -257,21 +259,26 @@ func (p *Task) getTransactionIfApplied(ctx context.Context, msg *types.Message, return false, nil, xerrors.Errorf("failed to load previous actor state: %w", err) } - var tx transaction + var tx *transaction if err := prevActorState.ForEachPendingTxn(func(id int64, txn multisig.Transaction) error { if id == int64(params.ID) { - tx.id = int64(params.ID) - tx.to = txn.To.String() - tx.value = txn.Value.String() - return nil + tx = &transaction{ + id: int64(params.ID), + to: txn.To.String(), + value: txn.Value.String(), + } } - return xerrors.Errorf("pending transaction %d not found", params.ID) + return nil }); err != nil { return false, nil, xerrors.Errorf("failed to read transaction details: %w", err) } - return true, &tx, nil + if tx == nil { + return false, nil, xerrors.Errorf("pending transaction %d not found", params.ID) + } + + return true, tx, nil default: // Not interested in any other methods