address review comment

This commit is contained in:
Fridrik Asmundsson 2023-04-21 20:03:13 +00:00 committed by Maciej Witowski
parent 95b92f306a
commit 79be473e75

View File

@ -1056,11 +1056,6 @@ func (mp *MessagePool) getStateNonce(ctx context.Context, addr address.Address,
return n, nil return n, nil
} }
raddr, err := mp.resolveToKey(ctx, addr)
if err != nil {
return 0, err
}
// get the nonce from the actor before ts // get the nonce from the actor before ts
actor, err := mp.api.GetActorBefore(addr, ts) actor, err := mp.api.GetActorBefore(addr, ts)
if err != nil { if err != nil {
@ -1068,6 +1063,11 @@ func (mp *MessagePool) getStateNonce(ctx context.Context, addr address.Address,
} }
nextNonce := actor.Nonce nextNonce := actor.Nonce
raddr, err := mp.resolveToKey(ctx, addr)
if err != nil {
return 0, err
}
// loop over all messages sent by 'addr' and find the highest nonce // loop over all messages sent by 'addr' and find the highest nonce
messages, err := mp.api.MessagesForTipset(ctx, ts) messages, err := mp.api.MessagesForTipset(ctx, ts)
if err != nil { if err != nil {