forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Labels
Description
Currently the mininode lock is a global, expected to be imported into test scripts and used accordingly. This has several issues:
- Importing a global is easy to forget
- Having the symbol in the global namespace might make it easy to use incorrect (in the wrong context)
- A global might lead to less clear code, compared to code using a member variable
While there is only one python network thread, and thus a single global lock is sufficient, having the lock be a private member variable on the mininode could make code more clear.
It would also clarify test code, because it encourages to write getter/setter helper methods that take the private lock as opposed to inlined logic that might or might not take the lock.
Want to work on this issue?
For guidance on contributing, please read CONTRIBUTING.md before opening your pull request.