While messing around with various zmq data ingestion setups for a side project I initially was perplexed because my node kept returning an empty array when I called bitcoin-cli getzmqnotifications even though I had 4 zmq emitters configured.
Upon closer inspection, it looks like if a single zmq config is invalid / fails to be bound, it prevents all other zmq configurations from being bound. And even worse, the failure occurs silently.
The goal of this PR is to not allow one invalid config to prevent valid configs from working and to make binding failures more obvious in the node logs. Alternatively, if reviewers find it preferable, we could make any zmq bind failure to be a hard error that blocks the node from launching.
Initialize() now attempts every configured notifier, erases only the failed ones, and returns success if at least one remains. Failures are logged:
- Per-notifier: Failed to initialize ZMQ notifier <type> at address <addr>; it will be disabled
- Summary: Initialized X of Y ZMQ notifier(s); Z failed
getzmqnotifications now reports the surviving notifiers instead of returning [].
Added ZMQAddressKey() to canonicalize addresses for socket sharing:
- tcp://localhost:N and tcp://127.0.0.1:N now share one socket.
- Hostname resolution prefers IPv4 unless the address is a numeric IPv6 literal, matching IsZMQAddressIPV6()/libzmq behavior.
- Wildcard */empty hosts map to the IPv4 any address.
Each notifier now stores its canonical key, Shutdown() uses it, and failed init paths clear psocket after zmq_close() to avoid the previous double-close hazard.