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

jsonrpc: Add runaccountmixer method #2437

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jholdstock
Copy link
Member

This new method starts an account mixer in the background and returns to the client without blocking. This differs from the gRPC version of runaccountmixer which blocks until the account mixer returns.

Draft until #2434 and #2435 are reviewed/merged and this is rebased.

This ensures that the context of in-flight RPC requests is cancelled
when the dcrwallet process context is cancelled.
Use the server waitgroup to ensure background rescans can return on
their own terms rather than being forcefully terminated early.

This is still not an ideal situation because in the case where the
server/wallet is being shut down, RescanFromHeight will return with an
"rpc connection closed" error (or similar) rather than returning because
its provided context was cancelled. However, that is a notable
improvement over the existing situation which could result in an
unhandled panic.
Using the server context instead of context.Background means that the
long-lived rescan funcs are able to exit properly when the server is
shutdown and its context is closed.
This new method starts an account mixer in the background and returns to
the client without blocking. This differs from the gRPC version of
runaccountmixer which blocks until the account mixer returns.
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

Successfully merging this pull request may close these issues.

1 participant