Skip to content

Minor bugs in server/swap function processBlock#3587

Open
jholdstock wants to merge 2 commits intodecred:masterfrom
jholdstock:processBlock-bugs
Open

Minor bugs in server/swap function processBlock#3587
jholdstock wants to merge 2 commits intodecred:masterfrom
jholdstock:processBlock-bugs

Conversation

@jholdstock
Copy link
Copy Markdown
Member

No description provided.

It seemed that return was being used instead of continue mistakenly,
which could lead to situations where the loop incorrectly exits early
and not all matches are evaluated.
Using defer to unlock the mutex means that the mutex can be locked
repeatedly during the loop and only unlocked when the function returns,
rather than being unlocked at the end of the current loop iteration.

This can lead to the mutex being held for longer than required.
Copy link
Copy Markdown
Contributor

@norwnd norwnd left a comment

Choose a reason for hiding this comment

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

Good find!

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