-
Notifications
You must be signed in to change notification settings - Fork 36.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize -regtest setgenerate block generation
Speed up generating blocks in regression test mode, by moving block-creating and nonce-finding directly into the setgenerate RPC call (instead of starting up a mining thread and waiting for it to find a block). This makes the forknotify RPC test three times quicker, for example (10 seconds runtime instead of 30 seconds, assuming the initial blockchain cache is already built).
- Loading branch information
1 parent
3d3ce74
commit 1837987
Showing
1 changed file
with
22 additions
and
8 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
1837987
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed this.
As I pointed out in #4423 removing the miner optimization could actually be an optimization for the regtest case. We concluded there or in #4793 that we only care about the miner for testing. I would still be happy to remove the mining optimization if people agree.
Let's recapitulate:
The logical conclusion is that the miner optimization doesn't make sense. Let's remove it to simplify that part of the code. Less code to maintain and no drawbacks.