mining: Improve template key handling. #1709
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This factors out the code which deals with generating a unique block template key to a separate function, modifies it to only be comprised of the merkle root + timestamp, and renames the associated variables
accordingly. The separate function is useful because work submission will ultimately need to create the same key.
The rationale for switching to only using the merkle root + timestamp is as follows:
Finally, the naming is also being changed from ID to key because the name
templateID
already has a distinct meaning in therpcserver
code in how it applies to long polling clients and it is better to avoid potential confusion.