Skip to content

Commit 4dfe946

Browse files
committed
hww: show deprecation warning once
1 parent 83b233d commit 4dfe946

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

electrum/plugins/digitalbitbox/digitalbitbox.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def derive_keys(x):
7373

7474
ENCRYPTION_PRIVKEY_KEY = 'encryptionprivkey'
7575
CHANNEL_ID_KEY = 'comserverchannelid'
76-
76+
DEPRECATION_WARNING_SHOWN = False
7777

7878
class DigitalBitbox_Client(HardwareClientBase):
7979
def __init__(self, plugin, hidDevice):
@@ -142,7 +142,9 @@ def get_xpub(self, bip32_path, xtype):
142142
"You should move your coins and migrate to a modern hardware device.")
143143
_logger.warning(deprecation_warning.replace("\n", " "))
144144

145-
if self.handler:
145+
global DEPRECATION_WARNING_SHOWN
146+
if self.handler and not DEPRECATION_WARNING_SHOWN:
147+
DEPRECATION_WARNING_SHOWN = True
146148
self.handler.show_warning(deprecation_warning, blocking=True)
147149

148150
return xpub

electrum/plugins/safe_t/clientbase.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
from electrum.hw_wallet.plugin import HardwareClientBase, HardwareHandlerBase
1414

1515

16+
DEPRECATION_WARNING_SHOWN = False
17+
18+
1619
class GuiMixin(object):
1720
# Requires: self.proto, self.device
1821
handler: Optional[HardwareHandlerBase]
@@ -182,7 +185,9 @@ def get_xpub(self, bip32_path, xtype):
182185
"You should move your coins and migrate to a modern hardware device.")
183186
self.logger.warning(deprecation_warning.replace("\n", " "))
184187

185-
if self.handler:
188+
global DEPRECATION_WARNING_SHOWN
189+
if self.handler and not DEPRECATION_WARNING_SHOWN:
190+
DEPRECATION_WARNING_SHOWN = True
186191
self.handler.show_warning(deprecation_warning, blocking=True)
187192

188193
return BIP32Node(xtype=xtype,

0 commit comments

Comments
 (0)