Skip to content

Commit

Permalink
Update node/tx_checker.go
Browse files Browse the repository at this point in the history
Co-authored-by: beer-1 <[email protected]>
  • Loading branch information
sh-cha and beer-1 authored Dec 10, 2024
1 parent 91edf41 commit 39965cd
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions node/tx_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@ import (
"go.uber.org/zap"
)

// txChecker checks pending txs and handle events if the tx is included in the block
// in the case that the tx hash is not indexed by the node even if the tx is processed,
// event handler will not be called.
// so, it is recommended to use the event handler only for the check event (e.g. logs)
// txChecker continuously checks for pending transactions and handles events if the transaction is included in a block.
// If the transaction hash is not indexed by the node, even if the transaction is processed, the event handler will not be called.
// It is recommended to use the event handler only for logging or monitoring purposes.
//
// Parameters:
// - ctx: The context for managing the lifecycle of the txChecker.
// - enableEventHandler: A boolean flag to enable or disable event handling.
//
// Returns:
// - error: An error if the txChecker encounters an issue.
func (n *Node) txChecker(ctx types.Context, enableEventHandler bool) error {
if !n.HasBroadcaster() {
return nil
Expand Down

0 comments on commit 39965cd

Please sign in to comment.