Skip to content

Re-write nano::election::vote in a more readable way #4108

@dsiganos

Description

@dsiganos

Re-write the method nano::election::vote in a cleaner more readable style using guard if statements with early exits to avoid the deeply nested if blocks. Also, convert the expression
last_vote_l.timestamp < timestamp_a || (last_vote_l.timestamp == timestamp_a && last_vote_l.hash < block_hash_a)
to be more easily readable by using multiple if statements.

Metadata

Metadata

Labels

good first issueGood for newcomersquality improvementsThis item indicates the need for or supplies changes that improve maintainability

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions