public void Init() { _Aggregator.Subscribe <NBXplorerStateChangedEvent>(async(s, evt) => { if (evt.NewState == NBXplorerState.Ready) { s.Unsubscribe(); try { var callback = await _CallbackController.GetCallbackBlockUriAsync(); await _CallbackController.RegisterCallbackBlockUriAsync(callback); Logs.PayServer.LogInformation($"Registering block callback to " + callback); } catch (Exception ex) { Logs.PayServer.LogError(ex, "Could not register block callback"); s.Resubscribe(); } } }); }
public void Resubscribe() { aggregator.Subscribe(t, this); }