Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to detect connection error #205

Open
SwapMarket opened this issue Nov 23, 2024 · 0 comments
Open

Fails to detect connection error #205

SwapMarket opened this issue Nov 23, 2024 · 0 comments

Comments

@SwapMarket
Copy link

SwapMarket commented Nov 23, 2024

This always results in "Connected to ZMQ" even when my node is not running. Ubuntu 22, elements core, zmq4 v1.2.11.

func setupSubscriber() (*zmq4.Socket, error) {
	// Set up ZMQ subscriber
	subscriber, err := zmq4.NewSocket(zmq4.SUB)
	if err != nil {
		return nil, fmt.Errorf("failed to create ZMQ subscriber: %v", err)
	}

	err = subscriber.Connect(config.Config.ZmqPubRawTx)
	if err != nil {
		return nil, fmt.Errorf("failed to connect to ZMQ: %v", err)
	}

	// Subscribe to raw transaction notifications
	err = subscriber.SetSubscribe("")
	if err != nil {
		subscriber.Close()
		return nil, fmt.Errorf("failed to subscribe to ZMQ topic: %v", err)
	}

	log.Println("Connected to ZMQ")
	return subscriber, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant