This PR catches four birds with one stone:
- fixes #36515
- add a new
getTotalFees()getter so IPC clients don't have to sum up individual transaction fees - storing fees in
m_total_feessimplifies theWaitAndCreateNewBlockimplementation. - make it easier to add fee info to (future) external templates, as requested in #35671 (comment)
The last commit contains the fix for #36515, which is made easier by the changes before it. It can be tested with: https://gist.github.com/Sjors/832841d705e62a6addaf8e6d4cf1b155 (the test itself didn't seem worth including, though I could look into simplifying it)
In case this PR doesn't make it, I'll open a fresh one with a direct fix.