-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #883: [RPC][Mining] Extract last Hashspeed calculation
ea18c5a [RPC][Mining] Extract last Hashspeed calculation (Cave Spectre) Pull request description: ### Problem Users want to be able to see their current hashing speed ### Solution Extract the last calculated hashspeed and provide it in `getmininginfo`. To note, this only pulls the last calculation that was done, and is not a real-time pull. It will be the average from the start of mining to the last calculation, from the time the first `generatecontinuous true` was run. In other words, this will take into account any 'breaks' taken in mining. e.g. if you have a script that turns off mining for a certain time; the hash speed calculations are still being run; and the break will be calculated into your overall hash rate. Logic was added to `setminingalgo` to reset the statistical counters. So after `setminingalgo` is issued, the statistics will restart on the next `generatecontinuous`. This can be used to reset your counters even if you're not changing algorithms by setting your mining algo to the same algo: ``` $ ./veil-cli -regtest getmininginfo { [...] "hashspeed": 743034, [...] } $ ./veil-cli -regtest setminingalgo sha256d { "success": true, "message": "Mining algorithm changed from sha256d to sha256d" } $ ./veil-cli -regtest getmininginfo { [...] "hashspeed": 0, } ``` Note that for simplicity sake, the calculation is "hashes per second", so that it can remain a numerical value and users can wrap the use however they wish if they want to convert it to kh/s or mh/s [or whatever they desire] Tree-SHA512: 484be9de3f40acf76b60db16ba071a2585f1bce7b5852f6371f66d9ff0089b50576893d44981055526d81626c543d00701e38ada603535cc1ade4601627751a3
- Loading branch information
Showing
3 changed files
with
36 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters