Skip to content

Commit

Permalink
(fix) Added validation in SyncBroadcast code to avoid waiting to see …
Browse files Browse the repository at this point in the history
…the TX in the mainpool if it has been rejected by the node during broadcast
  • Loading branch information
aarmoa authored and shibaeff committed Oct 3, 2024
1 parent bb9ef54 commit d2c8a23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/chain/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ func (c *chainClient) SyncBroadcastSignedTx(txBytes []byte) (*txtypes.BroadcastT
ctx := context.Background()

res, err := common.ExecuteCall(ctx, c.network.ChainCookieAssistant, c.txClient.BroadcastTx, &req)
if err != nil {
if err != nil || res.TxResponse.Code != 0 {
return res, err
}

Expand Down Expand Up @@ -904,7 +904,7 @@ func (c *chainClient) broadcastTx(
}

res, err := common.ExecuteCall(context.Background(), c.network.ChainCookieAssistant, c.txClient.BroadcastTx, &req)
if !await || err != nil {
if err != nil || res.TxResponse.Code != 0 || !await {
return res, err
}

Expand Down

0 comments on commit d2c8a23

Please sign in to comment.