Closed ryanholmdahl closed 6 years ago
It seems weird to tie polls and coin updates together with polls to coin update, if you want to double the poll frequency you have to calculate doubling the # of polls per coin update. I would recommend having poll and coin update times separate. rest looked good but I'll relook more later.
Added a commit that addresses the problem. Now, the times are decoupled, but they're still on the same thread in the same loop, so it might not be perfect timing (either can be delayed if the other takes too long). Personally, I think this is better than doing them on separate threads, since I wouldn't want one to occur while the other is still doing something, but if you feel strongly we can try multithreading.
Great looks good, feel free to merge. Any further changes related to this can be done in a separate pr.
It looks like a big diff, but basically all that's new is the
poll_miner
function, which checks if the miners have crashed and restarts them if they have. When I added this in, it made main extremely hard to read, so I've decomposed it a bit better to keep it legible. I'm happy to split that work into two separate pull requests if you feel it's appropriate.Thread sleeping is now based on the time between miner polls, and a profit check is done every X number of polls.
Closes #15.