mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user