aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Morcos <morcos@chaincode.com>2017-03-07 11:33:44 -0500
committerAlex Morcos <morcos@chaincode.com>2017-05-10 11:47:44 -0400
commit3810e976d6a3956dff9e66077415cf04c1fe1f90 (patch)
tree0f32c47253bb1b439a5935392822a080b58bad73 /test
parentc7447ec30348b338e77bc6429fbfac9f93549ef6 (diff)
Rewrite estimateSmartFee
Change the logic of estimateSmartFee to check a 60% threshold at half the target, a 85% threshold at the target and a 95% threshold at double the target. Always check the shortest time horizon possible and ensure that estimates are monotonically decreasing. Add a conservative mode, which makes sure that the 95% threshold is also met at longer time horizons as well.
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/smartfees.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/functional/smartfees.py b/test/functional/smartfees.py
index b7f4b86e7b..aafdb14846 100755
--- a/test/functional/smartfees.py
+++ b/test/functional/smartfees.py
@@ -116,8 +116,8 @@ def check_estimates(node, fees_seen, max_invalid, print_estimates = True):
for i,e in enumerate(all_estimates): # estimate is for i+1
if e >= 0:
valid_estimate = True
- # estimatesmartfee should return the same result
- assert_equal(node.estimatesmartfee(i+1)["feerate"], e)
+ if i >= 13: # for n>=14 estimatesmartfee(n/2) should be at least as high as estimatefee(n)
+ assert(node.estimatesmartfee((i+1)//2)["feerate"] > float(e) - delta)
else:
invalid_estimates += 1