-
-
Notifications
You must be signed in to change notification settings - Fork 613
/
piecestate.go
30 lines (24 loc) · 689 Bytes
/
piecestate.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package torrent
import (
"github.com/anacrolix/torrent/storage"
)
// The current state of a piece.
type PieceState struct {
Priority PiecePriority
storage.Completion
// The piece is being hashed, or is queued for hash. Deprecated: Use those fields instead.
Checking bool
Hashing bool
QueuedForHash bool
// The piece state is being marked in the storage.
Marking bool
// Some of the piece has been obtained.
Partial bool
// The v2 hash for the piece layer is missing.
MissingPieceLayerHash bool
}
// Represents a series of consecutive pieces with the same state.
type PieceStateRun struct {
PieceState
Length int // How many consecutive pieces have this state.
}