Introduce waitFeesChanged() mining interface #52
Closed
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 adds
waitFeesChanged()
to theMining
interface.The Stratum v2 protocol allows pushing out templates as fees in the mempool increase. This interface lets us know when it's time to do so.
Without Cluster Mempool however the implementation is "fake", instead returning every time a transaction is added to the mempool. So for now I'm keeping this draft. It's here to provide a complete and stable Mining interface for bitcoin#30437 to build on.
Unlike the entire
Mining
interface so far, this is not a refactor. It adds new functionality.The current implementation is very similiar to how longpolling in
getblocktemplate
works, which checksgetTransactionsUpdated
every 10 seconds.However once Cluster Mempool is added it will be cheap enough to frequently generate a block template, check if the fees have gone up enough and then return. That would cause a behaviour change if
getblocktemplate
were to usewaitFeesChanged()
, which is why this PR does not touch the longpolling code.TODO: