From 62662dc4cd710e2d86ee3bee3c30ab01dc7910de Mon Sep 17 00:00:00 2001 From: roman_harazha Date: Sat, 9 Mar 2024 18:08:24 +0200 Subject: [PATCH] move mutex locking --- internal/service/api/handlers/verify_proof.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/service/api/handlers/verify_proof.go b/internal/service/api/handlers/verify_proof.go index ea0714f..60c1d7b 100644 --- a/internal/service/api/handlers/verify_proof.go +++ b/internal/service/api/handlers/verify_proof.go @@ -85,6 +85,9 @@ func VerifyProof(w http.ResponseWriter, r *http.Request) { return } + NetworkConfig(r).LockNonce() + defer NetworkConfig(r).UnlockNonce() + gas, err := EthClient(r).EstimateGas(r.Context(), ethereum.CallMsg{ From: crypto.PubkeyToAddress(NetworkConfig(r).PrivateKey.PublicKey), To: ®istration, @@ -97,9 +100,6 @@ func VerifyProof(w http.ResponseWriter, r *http.Request) { return } - NetworkConfig(r).LockNonce() - defer NetworkConfig(r).UnlockNonce() - tx, err := types.SignNewTx( NetworkConfig(r).PrivateKey, types.NewCancunSigner(NetworkConfig(r).ChainID),