data/pieceStore: Incorrectly public PieceCompleted method
This commit is contained in:
parent
73208b97ca
commit
c89a391056
|
@ -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 {
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue