func (cl *Client) queuePieceCheck(t *Torrent, pieceIndex int) {
	piece := &t.pieces[pieceIndex]
	if piece.QueuedForHash {
		return
	}
	piece.QueuedForHash = true
	t.publishPieceChange(pieceIndex)
	go cl.verifyPiece(t, pieceIndex)
}
Currently doesn't really queue, but should in the future.
package torrent
import (
	"bufio"
	"bytes"
	"crypto/rand"
	"crypto/sha1"
	"encoding/hex"
	"errors"
	"expvar"
	"fmt"
	"io"
	"log"
	"math/big"
	mathRand "math/rand"
	"net"
	"net/url"
	"os"
	"path/filepath"
	"sort"
	"strconv"
	"strings"
	"time"
	"github.com/anacrolix/missinggo"
	"github.com/anacrolix/missinggo/bitmap"
	"github.com/anacrolix/missinggo/pproffd"
	"github.com/anacrolix/missinggo/pubsub"
	"github.com/anacrolix/sync"
	"github.com/anacrolix/utp"
	"github.com/anacrolix/torrent/bencode"
	"github.com/anacrolix/torrent/dht"
	"github.com/anacrolix/torrent/iplist"
	"github.com/anacrolix/torrent/metainfo"
	"github.com/anacrolix/torrent/mse"
	pp "github.com/anacrolix/torrent/peer_protocol"
	"github.com/anacrolix/torrent/storage"
	"github.com/anacrolix/torrent/tracker"
)
var (
	unwantedChunksReceived   = expvar.NewInt("chunksReceivedUnwanted")
	unexpectedChunksReceived = expvar.NewInt("chunksReceivedUnexpected")
	chunksReceived           = expvar.NewInt("chunksReceived")
	peersAddedBySource = expvar.NewMap("peersAddedBySource")
	uploadChunksPosted    = expvar.NewInt("uploadChunksPosted")
	unexpectedCancels     = expvar.NewInt("unexpectedCancels")
	postedCancels         = expvar.NewInt("postedCancels")
	duplicateConnsAvoided = expvar.NewInt("duplicateConnsAvoided")
	pieceHashedCorrect    = expvar.NewInt("pieceHashedCorrect")
	pieceHashedNotCorrect = expvar.NewInt("pieceHashedNotCorrect")
	unsuccessfulDials = expvar.NewInt("dialSuccessful")
	successfulDials   = expvar.NewInt("dialUnsuccessful")
	acceptUTP    = expvar.NewInt("acceptUTP")
	acceptTCP    = expvar.NewInt("acceptTCP")
	acceptReject = expvar.NewInt("acceptReject")
	peerExtensions                    = expvar.NewMap("peerExtensions")
	completedHandshakeConnectionFlags = expvar.NewMap("completedHandshakeConnectionFlags")
	connsToSelf = expvar.NewInt("connsToSelf")
	duplicateClientConns       = expvar.NewInt("duplicateClientConns")
	receivedMessageTypes       = expvar.NewMap("receivedMessageTypes")
	receivedKeepalives         = expvar.NewInt("receivedKeepalives")
	supportedExtensionMessages = expvar.NewMap("supportedExtensionMessages")
	postedMessageTypes         = expvar.NewMap("postedMessageTypes")
	postedKeepalives           = expvar.NewInt("postedKeepalives")
	requestsReceivedForMissingPieces = expvar.NewInt("requestsReceivedForMissingPieces")
)
const (
	defaultExtensionBytes = "\x00\x00\x00\x00\x00\x10\x00\x01"
	socketsPerTorrent     = 80
	torrentPeersHighWater = 200
	torrentPeersLowWater  = 50
	handshakesTimeout = 20 * time.Second
	metadataExtendedId = iota + 1  
	pexExtendedId
	extendedHandshakeClientVersion = "go.torrent dev 20150624"
)