fix full node painc

fix: full node painc  when calling  RPC  Filecoin.ClientRetrieve without the order.Tatol pecified.
This commit is contained in:
Reskorey 2021-04-23 15:43:41 +08:00 committed by GitHub
parent ad0fdd5ec5
commit 7738886936
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -600,6 +600,11 @@ func (a *API) clientRetrieve(ctx context.Context, order api.RetrievalOrder, ref
}
}
if order.Total.Int == nil {
finish(xerrors.Errorf("cannot make retrieval deal for null total"))
return
}
if order.Size == 0 {
finish(xerrors.Errorf("cannot make retrieval deal for zero bytes"))
return