But g_zmq_notification_interface
being null just means that we have no notifications enabled through the command-line. So with zmqaddnotification
, I would imagine that it actually is able to add a notification also in that case (in fact, that could be the primary usage - do not configure any notifications through the CLI and instead add them later by RPC). I. e., zmqaddnotification
would either initialise g_zmq_notification_interface
if it was null, or we would always initialise it (even if no notifications are specified) on startup.
(We then might want to have a separate argument to turn off ZMQ completely - but that would be something new and is not what we have today!)
Of course, a frontend would have to handle the case of the method failing just in case. But I think if the daemon has ZMQ support but was just started without notifications, then the method should simply return that information (empty array), rather than not be present. Especially with a hypothetical addzmqnotification
in the future, this behaviour makes more sense for me.