From 79be473e75e9fe421ca1a03624d737b9fc579e0d Mon Sep 17 00:00:00 2001 From: Fridrik Asmundsson Date: Fri, 21 Apr 2023 20:03:13 +0000 Subject: [PATCH] address review comment --- chain/messagepool/messagepool.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/chain/messagepool/messagepool.go b/chain/messagepool/messagepool.go index 74931e25a..a9ba85651 100644 --- a/chain/messagepool/messagepool.go +++ b/chain/messagepool/messagepool.go @@ -1056,11 +1056,6 @@ func (mp *MessagePool) getStateNonce(ctx context.Context, addr address.Address, return n, nil } - raddr, err := mp.resolveToKey(ctx, addr) - if err != nil { - return 0, err - } - // get the nonce from the actor before ts actor, err := mp.api.GetActorBefore(addr, ts) if err != nil { @@ -1068,6 +1063,11 @@ func (mp *MessagePool) getStateNonce(ctx context.Context, addr address.Address, } 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 messages, err := mp.api.MessagesForTipset(ctx, ts) if err != nil {