# SendDataWithRetry doesn't work properly(Retries will not happen)

Allora's SendDataWithRetry ignores errors returned in the first argument by Cosmos BroadcastTx, so retries never trigger on failed transactions.

- Payout: Contest reward
- Severity: medium
- Program: Allora
- Credited: volodya
- Disclosed: 2024-06-24
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2024-06-allora-judging/issues/52
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-06-allora%3AM-13
- Tags: domain:web3 impact:dos kind:contest platform:sherlock sev:medium tech:go technique:source-review vuln:business-logic

**Target:** appchain.go SendDataWithRetry function
**Root cause:** Cosmos SDK's BroadcastTxAsync returns errors in the first return value (TxResponse) with nil error, but Allora's code only checks the second error value, so it treats failed broadcasts as successes.
**Steps:**
1. Call `SendDataWithRetry` with a transaction that will fail (e.g., mempool full).
2. `BroadcastTx` returns a non-nil `TxResponse` containing the error and a nil `error`.
3. The code sees `err == nil` and breaks out of the retry loop, logging success.
4. No retry occurs despite the transaction failure.
**How found:** Code review comparing Allora's retry logic with Cosmos SDK's BroadcastTx implementation, noticing the error is returned in the first argument.
**Insight:** When integrating with SDKs, verify the actual error return convention; some functions return errors in the response object rather than the error variable.
