Commit 66e0a6d3 authored by David Vorick's avatar David Vorick

prevent files from being added to the repair queue if they are not being tracked

parent 1d968168
......@@ -98,6 +98,15 @@ func (cs *chunkStatus) numGaps(rs *repairState) int {
// addFileToRepairState will take a file and add each of the incomplete chunks
// to the repair state, along with data about which pieces need attention.
func (r *Renter) addFileToRepairState(rs *repairState, file *file) {
// Check that the file is being tracked, and therefor candidate for repair.
file.mu.Lock()
_, exists := r.tracking[file.name]
file.mu.Unlock()
if !exists {
// File is not being tracked, don't add it to the repair state.
return
}
// Fetch the list of potential contracts from the repair state.
contracts := make([]types.FileContractID, 0)
for contract := range rs.activeWorkers {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment