AddPart always verifies

This commit is contained in:
Ethan Buchman
2018-05-17 13:17:50 -04:00
parent bc8768cfea
commit e5220360c5
3 changed files with 9 additions and 11 deletions

View File

@ -176,7 +176,7 @@ func (ps *PartSet) Total() int {
return ps.total
}
func (ps *PartSet) AddPart(part *Part, verify bool) (bool, error) {
func (ps *PartSet) AddPart(part *Part) (bool, error) {
ps.mtx.Lock()
defer ps.mtx.Unlock()
@ -191,10 +191,8 @@ func (ps *PartSet) AddPart(part *Part, verify bool) (bool, error) {
}
// Check hash proof
if verify {
if !part.Proof.Verify(part.Index, ps.total, part.Hash(), ps.Hash()) {
return false, ErrPartSetInvalidProof
}
if !part.Proof.Verify(part.Index, ps.total, part.Hash(), ps.Hash()) {
return false, ErrPartSetInvalidProof
}
// Add part