From 5697527646f720827d76bc3a179c52d30639a903 Mon Sep 17 00:00:00 2001 From: Ebrahim Gomaa Date: Fri, 22 Dec 2023 07:55:16 +0200 Subject: [PATCH] reorder wait group done (#1340) --- core/transaction/entity.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/transaction/entity.go b/core/transaction/entity.go index 6c06356b0..70782c439 100644 --- a/core/transaction/entity.go +++ b/core/transaction/entity.go @@ -267,6 +267,7 @@ func SendTransactionSync(txn *Transaction, miners []string) error { if err != nil { fails <- err } + wg.Done() }() //nolint } wg.Wait() @@ -297,9 +298,6 @@ func SendTransactionSync(txn *Transaction, miners []string) error { } func sendTransactionToURL(url string, txn *Transaction, wg *sync.WaitGroup) ([]byte, error) { - if wg != nil { - defer wg.Done() - } postReq, err := util.NewHTTPPostRequest(url, txn) if err != nil { //Logger.Error("Error in serializing the transaction", txn, err.Error())