mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
Introduce a scale factor
For the per confirmation number tracking of data, introduce a scale factor so that in the longer horizones confirmations are bucketed together at a resolution of the scale. (instead of 1008 individual data points for each fee bucket, have 42 data points each covering 24 different confirmation values.. (1-24), (25-48), etc.. )
This commit is contained in:
@@ -99,13 +99,10 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
|
||||
BOOST_CHECK(origFeeEst[i-1] <= origFeeEst[i-2]);
|
||||
}
|
||||
int mult = 11-i;
|
||||
if (i > 1) {
|
||||
if (i % 2 == 0) { //At scale 2, test logic is only correct for even targets
|
||||
BOOST_CHECK(origFeeEst[i-1] < mult*baseRate.GetFeePerK() + deltaFee);
|
||||
BOOST_CHECK(origFeeEst[i-1] > mult*baseRate.GetFeePerK() - deltaFee);
|
||||
}
|
||||
else {
|
||||
BOOST_CHECK(origFeeEst[i-1] == CFeeRate(0).GetFeePerK());
|
||||
}
|
||||
}
|
||||
// Fill out rest of the original estimates
|
||||
for (int i = 10; i <= 48; i++) {
|
||||
@@ -177,7 +174,7 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
|
||||
block.clear();
|
||||
}
|
||||
BOOST_CHECK(feeEst.estimateFee(1) == CFeeRate(0));
|
||||
for (int i = 2; i < 10; i++) {
|
||||
for (int i = 2; i < 9; i++) { // At 9, the original estimate was already at the bottom (b/c scale = 2)
|
||||
BOOST_CHECK(feeEst.estimateFee(i).GetFeePerK() < origFeeEst[i-1] - deltaFee);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user