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

fix: stop race condition in output encumbrance #4613

Merged

Conversation

SWvheerden
Copy link
Collaborator

@SWvheerden SWvheerden commented Sep 5, 2022

Description

Add a mutex to stop a race condition in the output manager error. Its possible that if more than on transactions happens in near the same time, the transactions will select the same inputs.

How Has This Been Tested?

Unit tests

@SWvheerden SWvheerden changed the title fix: add mutex to stop race condition fix: stop race condition in output encumbrance Sep 5, 2022
stringhandler
stringhandler previously approved these changes Sep 5, 2022
@stringhandler stringhandler merged commit 31e130a into tari-project:development Sep 5, 2022
@SWvheerden SWvheerden mentioned this pull request Sep 6, 2022
stringhandler pushed a commit that referenced this pull request Sep 6, 2022
Description
---
Removes mutex added in #4613 

Motivation and Context
---
While the race condition is definitely possible in code, all code from the OMS runs synchronously, as shown by the fact that almost all functions have `&mut self` and rust blocks mut borrow across threads. This means that there is no race condition possible as this is all called synchronously. 

How Has This Been Tested?
---
@SWvheerden SWvheerden deleted the sw_add)output_mutex branch September 7, 2022 07:28
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.

None yet

2 participants