| 194 | |
| 195 | |
| 196 | void TxConfirmStats::Record(int blocksToConfirm, double feerate) |
| 197 | { |
| 198 | // blocksToConfirm is 1-based |
| 199 | if (blocksToConfirm < 1) |
| 200 | return; |
| 201 | int periodsToConfirm = (blocksToConfirm + scale - 1) / scale; |
| 202 | unsigned int bucketindex = bucketMap.lower_bound(feerate)->second; |
| 203 | for (size_t i = periodsToConfirm; i <= confAvg.size(); i++) { |
| 204 | confAvg[i - 1][bucketindex]++; |
| 205 | } |
| 206 | txCtAvg[bucketindex]++; |
| 207 | m_feerate_avg[bucketindex] += feerate; |
| 208 | } |
| 209 | |
| 210 | void TxConfirmStats::UpdateMovingAverages() |
| 211 | { |
no test coverage detected