This adds waitFeesChanged()
to the Mining
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 #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 checks getTransactionsUpdated
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 use waitFeesChanged()
, which is why this PR does not touch the longpolling code.
TODO:
- try with (draft) cluster mempool branch