Alternative approach to #31003, suggested in #31109 (comment).
This PR introduces waitNext()
. It waits for either the tip to update or for fees at the top of the mempool to rise sufficiently. It then returns a new template, with which the caller can rinse and repeat.