Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

[PAN-2897] Return hashrate of 0 when not mining. #1672

Merged
merged 1 commit into from
Jul 11, 2019

Conversation

rojotek
Copy link
Member

@rojotek rojotek commented Jul 11, 2019

Return Hashrate of 0 when not mining.

@rojotek rojotek requested review from ajsutton and EdJoJob July 11, 2019 05:05
Copy link
Contributor

@EdJoJob EdJoJob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me

return new JsonRpcErrorResponse(req.getId(), JsonRpcError.NO_HASHES_PER_SECOND);
return hashesPerSecond
.map(hashes -> new JsonRpcSuccessResponse(req.getId(), Quantity.create(hashes)))
.orElseGet(() -> new JsonRpcSuccessResponse(req.getId(), Quantity.create(0)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return new JsonRpcSuccessResponse(req.getId(), Quantity.create(hashesPerSecond.orElse(0))?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep -- I made it better -- you've helped more -- thanks.

@ajsutton
Copy link
Contributor

You've also accidentally reverted the reference test upgrade. Checkout master, run git submodule update then checkout this branch again and git commit -a I think to commit it back to the right version so the build passes.

@rojotek rojotek merged commit 2e9a17d into PegaSysEng:master Jul 11, 2019
@rojotek rojotek deleted the eth-hashrate-not-mining branch July 11, 2019 06:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants