Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Farber98 committed Dec 9, 2024
1 parent 4a20622 commit 53948e1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/solana/txm/pendingtx.go
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,13 @@ func (c *pendingTxContext) OnReorg(sig solana.Signature) (pendingTx, error) {
return "", ErrTransactionNotFound
}

// reset state to broadcasted and update the transaction in the broadcasted map
// Reset the transaction state to 'Broadcasted' upon detecting a reorg.
// Even if the transaction might have already progressed to 'Processed' before the reorg,
// we reset it to 'Broadcasted' for simplicity.
// Any state advancements (e.g., moving to 'Processed' or 'Confirmed') will be picked up
// on the next status polling cycle.
// This approach does not introduce any risk with the expiration logic since
// we check for status changes before considering a transaction for expiration.
info.state, pTx.state = Broadcasted, Broadcasted
c.sigToTxInfo[sig] = info
c.broadcastedProcessedTxs[info.id] = pTx
Expand Down

0 comments on commit 53948e1

Please sign in to comment.