-
Notifications
You must be signed in to change notification settings - Fork 492
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
Introduce PeriodicRunner
in WasabiSynchronizer
#12269
Introduce PeriodicRunner
in WasabiSynchronizer
#12269
Conversation
PeriodicRunner
in WasabiSynchronize
PeriodicRunner
in WasabiSynchronizer
Arguably |
cACK. It looks very good to me. I will review it asap. |
@@ -132,7 +133,7 @@ private static ITransactionBroadcasterModel CreateBroadcaster(Network network) | |||
|
|||
private static IAmountProvider CreateAmountProvider() | |||
{ | |||
return new AmountProvider(Services.Synchronizer); | |||
return new AmountProvider(Services.HostedServices.Get<WasabiSynchronizer>()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Theoretical question:
Isn't it problematic that we require a non-static object inside a static function?
I tested and nothing is broken, just a question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overally LGTM, I couldn't break the wallet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK
Built upon #12262, this PR introduces
PeriodicRunner
inWasabiSynchronizer
as a base class.With this change we can rework the running logic of
WasabiSynchronizer
which before was basically a "PeriodicRunner
by hand".Now that the old base class was changed, we can use
PeriodicRunner
instead to runWasabiSynchronizer
regularly.With these changes,
WasabiSynchronizer
was registered as aHostedService
.The action logic is the same, a few logical details was tweaked so it fits and behaves the same as before.