Qt: FeerateEdit.get_amount now returns sat/byte
This commit is contained in:
@@ -121,9 +121,7 @@ class FeerateEdit(BTCAmountEdit):
|
|||||||
|
|
||||||
def get_amount(self):
|
def get_amount(self):
|
||||||
sat_per_byte_amount = BTCAmountEdit.get_amount(self)
|
sat_per_byte_amount = BTCAmountEdit.get_amount(self)
|
||||||
if sat_per_byte_amount is None:
|
return quantize_feerate(sat_per_byte_amount)
|
||||||
return None
|
|
||||||
return 1000 * sat_per_byte_amount
|
|
||||||
|
|
||||||
def setAmount(self, amount):
|
def setAmount(self, amount):
|
||||||
amount = quantize_feerate(amount)
|
amount = quantize_feerate(amount)
|
||||||
|
|||||||
@@ -1338,7 +1338,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
|||||||
if freeze_feerate or self.fee_slider.is_active():
|
if freeze_feerate or self.fee_slider.is_active():
|
||||||
displayed_feerate = self.feerate_e.get_amount()
|
displayed_feerate = self.feerate_e.get_amount()
|
||||||
if displayed_feerate:
|
if displayed_feerate:
|
||||||
displayed_feerate = quantize_feerate(displayed_feerate / 1000)
|
displayed_feerate = quantize_feerate(displayed_feerate)
|
||||||
else:
|
else:
|
||||||
# fallback to actual fee
|
# fallback to actual fee
|
||||||
displayed_feerate = quantize_feerate(fee / size) if fee is not None else None
|
displayed_feerate = quantize_feerate(fee / size) if fee is not None else None
|
||||||
@@ -1438,8 +1438,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
|||||||
if self.is_send_fee_frozen():
|
if self.is_send_fee_frozen():
|
||||||
fee_estimator = self.fee_e.get_amount()
|
fee_estimator = self.fee_e.get_amount()
|
||||||
elif self.is_send_feerate_frozen():
|
elif self.is_send_feerate_frozen():
|
||||||
amount = self.feerate_e.get_amount()
|
amount = self.feerate_e.get_amount() # sat/byte feerate
|
||||||
amount = 0 if amount is None else amount
|
amount = 0 if amount is None else amount * 1000 # sat/kilobyte feerate
|
||||||
fee_estimator = partial(
|
fee_estimator = partial(
|
||||||
simple_config.SimpleConfig.estimate_fee_for_feerate, amount)
|
simple_config.SimpleConfig.estimate_fee_for_feerate, amount)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user