MCPcopy
hub / github.com/syncthing/syncthing / GetBlockCounts

Method GetBlockCounts

lib/model/devicedownloadstate.go:154–168  ·  view source on GitHub ↗

GetBlockCounts returns a map filename -> number of blocks downloaded for the given folder.

(folder string)

Source from the content-addressed store, hash-verified

152// GetBlockCounts returns a map filename -> number of blocks downloaded for the
153// given folder.
154func (t *deviceDownloadState) GetBlockCounts(folder string) map[string]int {
155 if t == nil {
156 return nil
157 }
158
159 t.mut.RLock()
160 defer t.mut.RUnlock()
161
162 for name, state := range t.folders {
163 if name == folder {
164 return state.GetBlockCounts()
165 }
166 }
167 return nil
168}
169
170func (t *deviceDownloadState) BytesDownloaded(folder string) int64 {
171 if t == nil {

Callers 1

DownloadProgressMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected