From 48527b150135d36fd9fc7c54720dbbe42532af48 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Wed, 9 Oct 2024 15:09:49 +0000 Subject: [PATCH] sweep: trivial clean-up - wallet.get_receiving_addresses is guaranteed to exist (maybe it was only for HD wallets in the past) - wallet.is_mine is stricter than wallet.adb.is_mine, usually we want the former --- electrum/gui/qml/qetxfinalizer.py | 2 +- electrum/gui/qt/main_window.py | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/electrum/gui/qml/qetxfinalizer.py b/electrum/gui/qml/qetxfinalizer.py index 1fd6818d4..5273d71a4 100644 --- a/electrum/gui/qml/qetxfinalizer.py +++ b/electrum/gui/qml/qetxfinalizer.py @@ -901,7 +901,7 @@ class QETxSweepFinalizer(QETxFinalizer): def make_sweep_tx(self): address = self._wallet.wallet.get_receiving_address() - assert self._wallet.wallet.adb.is_mine(address) + assert self._wallet.wallet.is_mine(address) coins, keypairs = copy.deepcopy(self._txins) outputs = [PartialTxOutput.from_address_and_value(address, value='!')] diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py index ddb2ad815..ed6beef45 100644 --- a/electrum/gui/qt/main_window.py +++ b/electrum/gui/qt/main_window.py @@ -2387,10 +2387,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener): addresses = self.wallet.get_unused_addresses() if not addresses: - try: - addresses = self.wallet.get_receiving_addresses() - except AttributeError: - addresses = self.wallet.get_addresses() + addresses = self.wallet.get_receiving_addresses() h, address_e = address_field(addresses) vbox.addLayout(h)