Refactor CBlockPolicyEstimator#9942
Conversation
c3b3de4 to
35e9c1a
Compare
src/policy/fees.cpp
Outdated
| LOCK(cs_feeEstimator); | ||
| int nVersionRequired, nVersionThatWrote, nFileBestSeenHeight; | ||
| filein >> nVersionRequired >> nVersionThatWrote; | ||
| filein >> nFileBestSeenHeight; |
There was a problem hiding this comment.
Probably best to still check the nVersion before reading any further, no?
There was a problem hiding this comment.
oops. thats a pretty big oversight. will fix.
|
utACK 40d31d0 |
|
Should the fixup be squashed first before merging this? |
40d31d0 to
645946d
Compare
|
Squashed 40d31d0 (moveTxConfirmStats.tag1) -> 645946d |
|
utAck 645946d. Later work needs to clean up the TxConfirmedStats pointer usage, but that is a complex refactor and outside the scope of this PR. |
and change to storing as a pointer.
645946d to
68af651
Compare
|
Rebased. No changes from 645946d |
|
utACK 68af651. Nice cleanups, seems good to move this stuff out of the mempool. |
|
utACK 68af651 |
| } | ||
| vfeelist.push_back(INF_FEERATE); | ||
| feeStats.Initialize(vfeelist, MAX_BLOCK_CONFIRMS, DEFAULT_DECAY); | ||
| feeStats = new TxConfirmStats(vfeelist, MAX_BLOCK_CONFIRMS, DEFAULT_DECAY); |
There was a problem hiding this comment.
heh... i agree, but i wanted to move code to .cpp file and then i was screwed by lack of a destructor. I'm sure there is a better way, but I went around in circles chasing my tail for a while.. Maybe we could save that for an actual programmer to clean up later.
68af651 MOVEONLY: move TxConfirmStats to cpp (Alex Morcos) 2332f19 Initialize TxConfirmStats in constructor (Alex Morcos) 5ba81e5 Read and Write fee estimate file directly from CBlockPolicyEstimator (Alex Morcos) 14e10aa Call estimate(Smart)Fee directly from CBlockPolicyEstimator (Alex Morcos) dbb9e36 Give CBlockPolicyEstimator it's own lock (Alex Morcos) f6187d6 Make processBlockTx private. (Alex Morcos) ae7327b Make feeEstimator its own global instance of CBlockPolicyEstimator (Alex Morcos) Tree-SHA512: dbf3bd2b30822e609a35f3da519b62d23f8a50e564750695ddebd08553b4c01874ae3e07d792c6cc78cc377d2db33b951ffedc46ac7edaf5793f9ebb931713af
68af651 MOVEONLY: move TxConfirmStats to cpp (Alex Morcos) 2332f19 Initialize TxConfirmStats in constructor (Alex Morcos) 5ba81e5 Read and Write fee estimate file directly from CBlockPolicyEstimator (Alex Morcos) 14e10aa Call estimate(Smart)Fee directly from CBlockPolicyEstimator (Alex Morcos) dbb9e36 Give CBlockPolicyEstimator it's own lock (Alex Morcos) f6187d6 Make processBlockTx private. (Alex Morcos) ae7327b Make feeEstimator its own global instance of CBlockPolicyEstimator (Alex Morcos) Tree-SHA512: dbf3bd2b30822e609a35f3da519b62d23f8a50e564750695ddebd08553b4c01874ae3e07d792c6cc78cc377d2db33b951ffedc46ac7edaf5793f9ebb931713af finish bitcoin#9942 by removing removed functions Signed-off-by: Pasta <[email protected]>
This moves towards disentangling CBlockPolicyEstimator from CTxMemPool by making it its own global object. At the end of this PR, the CTxMemPool still has to know about CBlockPolicyEstimator, but this lays the ground work so that in the future CBlockPolicyEstimator can just subscribe to transaction and block events and the mempool will know nothing about it.
The last two commits are preparation for future work where there will be multiple TxConfirmStats in the CBlockPolicyEstimator which all refer to the same set of buckets.
I've grouped the commits into this PR, because this is the of the commits which introduces no change into the fee estimates, so is possible to merge cleanly by itself. There are a set of major changes to fee estimation built on top of this that isn't finished yet.