-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(rpc): Fix bugs and performance of
getnetworksolps
& `getnetwork…
…hashps` RPCs (#7647) * Handle negative and zero getnetworksolsps arguments correctly * Simplify the solsps loop structure * Simplify loop by avoiding manual iteration and peeking * Avoid division by zero * Use min and max times rather than first and last times * Refactor block iterators so they are more efficient * Make finding chains easier * Simplify block iteration code * Remove implemented TODO comments * Simplify internal iterator state * Implement iteration by any chain item * Iterate block headers rather than full blocks * Ignore code that is (sometimes) dead * Fix a dead code warning * Add a no blocks in state error constant * Check result values in the RPC test * Fix invalid calculation handling
- Loading branch information
Showing
13 changed files
with
385 additions
and
191 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
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
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
Oops, something went wrong.