Skip to content

Commit f7c4e20

Browse files
committed
add guard check for zero computeMaxPrice
1 parent 7560892 commit f7c4e20

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/solana/solana_service.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,10 @@ func (ss *solanaService) SubmitTransaction(ctx context.Context, req commonsol.Su
302302
var cfg []utils.SetTxConfig
303303
if req.Cfg != nil {
304304
cfg = append(cfg, utils.SetEstimateComputeUnitLimit(false))
305-
if req.Cfg.ComputeLimit != nil {
305+
if req.Cfg.ComputeLimit != nil && *req.Cfg.ComputeLimit != 0 {
306306
cfg = append(cfg, utils.SetComputeUnitLimit(*req.Cfg.ComputeLimit))
307307
}
308-
if req.Cfg.ComputeMaxPrice != nil {
308+
if req.Cfg.ComputeMaxPrice != nil && *req.Cfg.ComputeMaxPrice != 0 {
309309
cfg = append(cfg, utils.SetComputeUnitPriceMax(*req.Cfg.ComputeMaxPrice))
310310
}
311311
}

0 commit comments

Comments
 (0)