do not try to dial nil node from audit verifier (#1027)

* do not try to dial nil node from audit verifier

* add todo
This commit is contained in:
Maximillian von Briesen 2019-01-10 15:13:40 -05:00 committed by GitHub
parent ef50bbf8b6
commit 058ef585aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,6 +60,11 @@ func NewVerifier(transport transport.Client, overlay overlay.Client, id provider
func (d *defaultDownloader) getShare(ctx context.Context, stripeIndex, shareSize, pieceNumber int,
id psclient.PieceID, pieceSize int64, fromNode *pb.Node, pba *pb.PayerBandwidthAllocation, authorization *pb.SignedMessage) (s share, err error) {
defer mon.Task()(&ctx)(&err)
if fromNode == nil {
// TODO(moby) perhaps we should not penalize this node's reputation if it is not returned by the overlay
return s, Error.New("no node returned from overlay for piece %s", id.String())
}
fromNode.Type.DPanicOnInvalid("audit getShare")
ps, err := psclient.NewPSClient(ctx, d.transport, fromNode, 0)
if err != nil {