File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -1948,6 +1948,8 @@ def _bump_fee_through_decreasing_change(
1948
1948
for o in s :
1949
1949
target_fee = int (math .ceil (tx .estimated_size () * new_fee_rate ))
1950
1950
delta = target_fee - tx .get_fee ()
1951
+ if delta <= 0 :
1952
+ break
1951
1953
i = outputs .index (o )
1952
1954
if o .value - delta >= self .dust_threshold ():
1953
1955
new_output_value = o .value - delta
@@ -1959,6 +1961,11 @@ def _bump_fee_through_decreasing_change(
1959
1961
del outputs [i ]
1960
1962
# note: we mutated the outputs of tx, which will affect
1961
1963
# tx.estimated_size() in the next iteration
1964
+ else :
1965
+ # recompute delta if there was no next iteration
1966
+ target_fee = int (math .ceil (tx .estimated_size () * new_fee_rate ))
1967
+ delta = target_fee - tx .get_fee ()
1968
+
1962
1969
if delta > 0 :
1963
1970
raise CannotBumpFee (_ ('Could not find suitable outputs' ))
1964
1971
You can’t perform that action at this time.
0 commit comments