diff --git a/node/pkg/wormconn/send_tx.go b/node/pkg/wormconn/send_tx.go index f12ad63c31..cf5391ee48 100644 --- a/node/pkg/wormconn/send_tx.go +++ b/node/pkg/wormconn/send_tx.go @@ -107,29 +107,20 @@ func (c *ClientConn) SignAndBroadcastTx(ctx context.Context, msg sdktypes.Msg) ( // waitForBlockInclusion waits for the tx to be included in a block, or times out after a given duration. func waitForBlockInclusion(ctx context.Context, client sdktx.ServiceClient, txHash string, waitTimeout time.Duration) (*sdktx.GetTxResponse, error) { - - now := time.Now() - exitAfter := time.After(waitTimeout) for { select { // check if wait timeout is exceeded case <-exitAfter: - fmt.Println("JOEL - TIMED OUT ", txHash) return nil, fmt.Errorf("timed out after: %d; wait for tx %s to be included in a block", waitTimeout, txHash) // check if in block every second - case <-time.After(3000 * time.Millisecond): + case <-time.After(100 * time.Millisecond): res, err := client.GetTx(ctx, &sdktx.GetTxRequest{Hash: txHash}) if err == nil { - took := time.Since(now) - fmt.Println("JOEL - FOUND TX IN BLOCK", txHash, " after ", took.Milliseconds(), "ms") return res, nil - } else { - fmt.Println("JOEL - NO TX YET IN BLOCK ", txHash) } // check if context is done case <-ctx.Done(): - fmt.Println("JOEL - CONTEXT DONE ", txHash, ctx.Err()) return nil, ctx.Err() } }