Don't try to output nil channel values

This commit is contained in:
Ingar Shu 2020-08-17 11:17:46 -07:00
parent ff7f0a9dcd
commit 5ace7479ad
No known key found for this signature in database
GPG Key ID: BE3D9CE79F22E769

View File

@ -854,15 +854,15 @@ var clientRetrieveCmd = &cli.Command{
for { for {
select { select {
case evt, chOpen := <-updates: case evt, ok := <-updates:
if ok {
fmt.Printf("> Recv: %s, Paid %s, %s (%s)\n", fmt.Printf("> Recv: %s, Paid %s, %s (%s)\n",
types.SizeStr(types.NewInt(evt.BytesReceived)), types.SizeStr(types.NewInt(evt.BytesReceived)),
types.FIL(evt.FundsSpent), types.FIL(evt.FundsSpent),
retrievalmarket.ClientEvents[evt.Event], retrievalmarket.ClientEvents[evt.Event],
retrievalmarket.DealStatuses[evt.Status], retrievalmarket.DealStatuses[evt.Status],
) )
} else {
if !chOpen {
fmt.Println("Success") fmt.Println("Success")
return nil return nil
} }