mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-28 16:01:30 +00:00
Qt: feerate edit was sometimes rounding inconsistently
This commit is contained in:
parent
d667c5d46e
commit
9788ca0250
1 changed files with 6 additions and 1 deletions
|
@ -6,7 +6,8 @@ from PyQt5.QtCore import *
|
||||||
from PyQt5.QtGui import *
|
from PyQt5.QtGui import *
|
||||||
from PyQt5.QtWidgets import (QLineEdit, QStyle, QStyleOptionFrame)
|
from PyQt5.QtWidgets import (QLineEdit, QStyle, QStyleOptionFrame)
|
||||||
|
|
||||||
from electrum.util import format_satoshis_plain, decimal_point_to_base_unit_name, FEERATE_PRECISION
|
from electrum.util import (format_satoshis_plain, decimal_point_to_base_unit_name,
|
||||||
|
FEERATE_PRECISION, quantize_feerate)
|
||||||
|
|
||||||
|
|
||||||
class MyLineEdit(QLineEdit):
|
class MyLineEdit(QLineEdit):
|
||||||
|
@ -123,3 +124,7 @@ class FeerateEdit(BTCAmountEdit):
|
||||||
if sat_per_byte_amount is None:
|
if sat_per_byte_amount is None:
|
||||||
return None
|
return None
|
||||||
return 1000 * sat_per_byte_amount
|
return 1000 * sat_per_byte_amount
|
||||||
|
|
||||||
|
def setAmount(self, amount):
|
||||||
|
amount = quantize_feerate(amount)
|
||||||
|
super().setAmount(amount)
|
||||||
|
|
Loading…
Add table
Reference in a new issue