@@ -902,6 +902,7 @@ class Abstract_Wallet(AddressSynchronizer):
|
|||||||
"""
|
"""
|
||||||
if tx.is_final():
|
if tx.is_final():
|
||||||
raise CannotBumpFee(_('Cannot bump fee') + ': ' + _('transaction is final'))
|
raise CannotBumpFee(_('Cannot bump fee') + ': ' + _('transaction is final'))
|
||||||
|
new_fee_rate = quantize_feerate(new_fee_rate) # strip excess precision
|
||||||
old_tx_size = tx.estimated_size()
|
old_tx_size = tx.estimated_size()
|
||||||
old_fee = self.get_tx_fee(tx)
|
old_fee = self.get_tx_fee(tx)
|
||||||
if old_fee is None:
|
if old_fee is None:
|
||||||
@@ -925,10 +926,12 @@ class Abstract_Wallet(AddressSynchronizer):
|
|||||||
tx=tx, new_fee_rate=new_fee_rate)
|
tx=tx, new_fee_rate=new_fee_rate)
|
||||||
method_used = 2
|
method_used = 2
|
||||||
|
|
||||||
actual_new_fee_rate = tx_new.get_fee() / tx_new.estimated_size()
|
target_min_fee = new_fee_rate * tx_new.estimated_size()
|
||||||
if quantize_feerate(actual_new_fee_rate) < quantize_feerate(new_fee_rate):
|
actual_fee = tx_new.get_fee()
|
||||||
raise Exception(f"bump_fee feerate target was not met (method: {method_used}). "
|
if actual_fee + 1 < target_min_fee:
|
||||||
f"got {actual_new_fee_rate}, expected >={new_fee_rate}")
|
raise Exception(f"bump_fee fee target was not met (method: {method_used}). "
|
||||||
|
f"got {actual_fee}, expected >={target_min_fee}. "
|
||||||
|
f"target rate was {new_fee_rate}")
|
||||||
|
|
||||||
tx_new.locktime = get_locktime_for_new_transaction(self.network)
|
tx_new.locktime = get_locktime_for_new_transaction(self.network)
|
||||||
return tx_new
|
return tx_new
|
||||||
|
|||||||
Reference in New Issue
Block a user