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