[NDF] Implement TODO about thread safety in churn limiter
MERGE REQUEST
Overview
This MR implements a todo in the churn limiter which mentioned a potential race condition. This seems to at least fix the following NDFS.
--- FAIL: TestSelectRandomCanceledHost (6.58s)
hostdb_test.go:389: Expected 1 inactive contract but got 0
--- FAIL: TestContractorChurnLimiter (44.93s)
contractor_test.go:1846: expected 1 disabled contracts but got 2
--- FAIL: TestRenterFileContractIdentifier (6.17s)
renter_test.go:3243: Expected 4 txns but got 2
Checklist
Review and complete the checklist to ensure that the MR is complete before assigned to an approver.
-
All new methods or updated methods have clear docstrings -
Testing added or updated for new methods -
Any new packages are added to Makefile and .gitlab-ci.yml -
API documentation updated for API updates -
Module README.md updated for changes to workflow -
Issue added to Sia-UI repo for new supporting features -
Changelog File Created
Edited by Christopher Schinnerl