Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix integer overflow for amount selection #291

Merged
merged 1 commit into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions electrumabc_gui/qt/address_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ class DataRoles(IntEnum):
address = Qt.UserRole + 0
can_edit_label = Qt.UserRole + 1

# emits the total number of satoshis for coins on selected addresses
selected_amount_changed = pyqtSignal(int)
# Emits the total number of satoshis for coins on selected addresses. It emits an
# integer, but we define it as a generic object because Qt would translate int to
# a 32 bits integer, which causes overflows for amounts > 21,474,836.47 XEC
selected_amount_changed = pyqtSignal(object)
selection_cleared = pyqtSignal()

def __init__(self, main_window: ElectrumWindow, *, picker=False):
Expand Down
6 changes: 4 additions & 2 deletions electrumabc_gui/qt/utxo_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ class Col(IntEnum):
# sort by amount, descending
default_sort = MyTreeWidget.SortSpec(Col.amount, Qt.DescendingOrder)

# emits the total number of satoshis for selected coins
selected_amount_changed = pyqtSignal(int)
# Emits the total number of satoshis for selected coins. It emits an
# integer, but we define it as a generic object because Qt would translate int to
# a 32 bits integer, which causes overflows for amounts > 21,474,836.47 XEC
selected_amount_changed = pyqtSignal(object)
selection_cleared = pyqtSignal()

def __init__(self, main_window: ElectrumWindow):
Expand Down