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 committed Oct 3, 2024
1 parent 92ece76 commit be869a6
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 be869a6

Please sign in to comment.