Skip to content

Commit f368b0c

Browse files
committed
should panic when no spare nonce
1 parent c5ecfcc commit f368b0c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

solana/observer.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import (
99
"sync"
1010
"time"
1111

12+
solanaApp "github.com/MixinNetwork/computer/apps/solana"
13+
"github.com/MixinNetwork/computer/store"
1214
"github.com/MixinNetwork/mixin/crypto"
1315
"github.com/MixinNetwork/mixin/logger"
14-
solanaApp "github.com/MixinNetwork/computer/apps/solana"
1516
"github.com/MixinNetwork/safe/common"
16-
"github.com/MixinNetwork/computer/store"
1717
"github.com/MixinNetwork/safe/mtg"
1818
"github.com/gagliardetto/solana-go"
1919
"github.com/gagliardetto/solana-go/rpc"
@@ -809,8 +809,8 @@ func (node *Node) processSuccessedCall(ctx context.Context, call *store.SystemCa
809809
if call.Type == store.CallTypeMain && !call.SkipPostProcess {
810810
cid := common.UniqueId(id, "post-process")
811811
nonce, err := node.store.ReadSpareNonceAccount(ctx)
812-
if err != nil {
813-
return err
812+
if err != nil || nonce == nil {
813+
return fmt.Errorf("store.ReadSpareNonceAccount() => %v %v", nonce, err)
814814
}
815815
tx := node.CreatePostProcessTransaction(ctx, call, nonce, txx, meta)
816816
if tx != nil {
@@ -842,8 +842,8 @@ func (node *Node) processFailedCall(ctx context.Context, call *store.SystemCall,
842842
if call.Type == store.CallTypeMain {
843843
cid := common.UniqueId(id, "post-process")
844844
nonce, err := node.store.ReadSpareNonceAccount(ctx)
845-
if err != nil {
846-
panic(err)
845+
if err != nil || nonce == nil {
846+
panic(fmt.Errorf("store.ReadSpareNonceAccount() => %v %v", nonce, err))
847847
}
848848
tx := node.CreatePostProcessTransaction(ctx, call, nonce, nil, nil)
849849
if tx != nil {

0 commit comments

Comments
 (0)