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

Break up and rename blockConnected function #444

Merged
merged 4 commits into from
Sep 19, 2023

Conversation

jholdstock
Copy link
Member

Splitting the large vspd.go file into several new files, and the blockConnected function into smaller, more specific functions.

Beyond the fact that small components are easier to maintain and reason about, this is also a step towards providing more granular (and thus more useful) log/error information,.

The name blockConnected is not very accurate as this function is also
called when vspd is initializing. It doesnt depend on a block having
been connected at all, it can be called at any time.
This splits the code from vspd.go into various other files which broadly
represent the functional areas of vspd - the main update function,
database intgrity checks and voting wallet consistency checks.

Code is just moved without any modifications.
The update function performs four distinct steps which can readily be
broken down into four separate functions.
This allows RPC clients to be reused more easily in the case that the
caller of findSpentTickets already has a connected dcrd RPC client.
Copy link
Member

@davecgh davecgh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've confirmed that the moved code is the same. The only changes are function renames, splitting code into separate functions and files, and passing the context and rpc client as parameters.

@jholdstock jholdstock merged commit c4de3d5 into decred:master Sep 19, 2023
2 checks passed
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.

2 participants