| 208 | } |
| 209 | |
| 210 | void TxConfirmStats::UpdateMovingAverages() |
| 211 | { |
| 212 | assert(confAvg.size() == failAvg.size()); |
| 213 | for (unsigned int j = 0; j < buckets.size(); j++) { |
| 214 | for (unsigned int i = 0; i < confAvg.size(); i++) { |
| 215 | confAvg[i][j] *= decay; |
| 216 | failAvg[i][j] *= decay; |
| 217 | } |
| 218 | m_feerate_avg[j] *= decay; |
| 219 | txCtAvg[j] *= decay; |
| 220 | } |
| 221 | } |
| 222 | |
| 223 | // returns -1 on error conditions |
| 224 | double TxConfirmStats::EstimateMedianVal(int confTarget, double sufficientTxVal, |