...
 
Commits (2)
......@@ -186,7 +186,8 @@ func (client *PowClient) PowFunc(trytes trinary.Trytes, minWeightMagnitude int,
client.outgoingReq <- pendingPowRequest
select {
case powResponse := <-pendingPowRequest.powResponseChan:
case powResponse, hasMore := <-pendingPowRequest.powResponseChan:
if hasMore {
// Got response
close(pendingPowRequest.powResponseChan)
result, err := trinary.NewTrytes(powResponse.Nonce)
......@@ -195,6 +196,8 @@ func (client *PowClient) PowFunc(trytes trinary.Trytes, minWeightMagnitude int,
}
return result, err
}
return "", errors.New("powResponseChan was closed")
case <-time.After(time.Duration(client.ReadTimeOutMs) * time.Millisecond):
// Timeout
......