data/pieceStore: Incorrectly public PieceCompleted method

This commit is contained in:
Matt Joiner 2016-02-17 17:10:34 +11:00
parent 73208b97ca
commit c89a391056
2 changed files with 2 additions and 2 deletions

View File

@ -106,7 +106,7 @@ func (me *data) WriteSectionTo(w io.Writer, off, n int64) (written int64, err er
}
func (me *data) PieceCompleted(index int) (err error) {
return me.store.PieceCompleted(me.info.Piece(index))
return me.store.pieceCompleted(me.info.Piece(index))
}
func (me *data) PieceComplete(piece int) bool {

View File

@ -232,7 +232,7 @@ func (me *store) hashCopyFile(from, to string, n int64) (hash []byte, err error)
return
}
func (me *store) PieceCompleted(p metainfo.Piece) (err error) {
func (me *store) pieceCompleted(p metainfo.Piece) (err error) {
hash, err := me.hashCopyFile(me.incompletePiecePath(p), me.completedPiecePath(p), p.Length())
if err == nil && !bytes.Equal(hash, p.Hash()) {
err = errors.New("piece incomplete")