NebulousLabs / Sia

Blockchain-based marketplace for file storage. Project has moved to GitLab: https://gitlab.com/NebulousLabs/Sia
https://sia.tech
MIT License
2.71k stars 440 forks source link

Contract maintenance #3158

Closed DavidVorick closed 6 years ago

DavidVorick commented 6 years ago

The threadedContractMaintenance thread was pretty opaque, and had some areas related to funding that were not very understandable, and probably not correct. I refactored the way that the loop checks for funds remaining, and I broke some of the more complex pieces of logic out into their own functions.

I think the tests are passing, though they actually keep timing out on my machine. The siatest renter tests seem to be taking more than 500 seconds, but not because one is deadlocked, rather by the time the later tests are going, the earlier tests have already pushed the timer over 400 seconds.