treplace bitcoin.is_valid - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit b9da5afa9d3848843a0c7944bdcbf99d5ba51421 DIR parent e853dde1113f5d3fb96b864aca283781abbd6f8e HTML Author: ThomasV <thomasv@electrum.org> Date: Thu, 31 Aug 2017 10:06:13 +0200 replace bitcoin.is_valid Diffstat: M gui/qt/main_window.py | 4 ++-- M gui/stdio.py | 4 ++-- M gui/text.py | 4 ++-- M lib/bitcoin.py | 5 ----- 4 files changed, 6 insertions(+), 11 deletions(-) --- DIR diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py t@@ -42,7 +42,7 @@ from electrum.util import bh2u, bfh from . import icons_rc from electrum import keystore -from electrum.bitcoin import COIN, is_valid, TYPE_ADDRESS +from electrum.bitcoin import COIN, is_address, TYPE_ADDRESS from electrum.plugins import run_hook from electrum.i18n import _ from electrum.util import (format_time, format_satoshis, PrintError, t@@ -1619,7 +1619,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): self.payto_e.setFocus() def set_contact(self, label, address): - if not is_valid(address): + if not is_address(address): self.show_error(_('Invalid Address')) self.contact_list.update() # Displays original unchanged value return False DIR diff --git a/gui/stdio.py b/gui/stdio.py t@@ -9,7 +9,7 @@ _ = lambda x:x #from i18n import _ from electrum import WalletStorage, Wallet from electrum.util import format_satoshis, set_verbosity -from electrum.bitcoin import is_valid, COIN, TYPE_ADDRESS +from electrum.bitcoin import is_address, COIN, TYPE_ADDRESS from electrum.network import filter_protocol import sys, getpass, datetime t@@ -169,7 +169,7 @@ class ElectrumGui: while self.done == 0: self.main_command() def do_send(self): - if not is_valid(self.str_recipient): + if not is_address(self.str_recipient): print(_('Invalid Bitcoin address')) return try: DIR diff --git a/gui/text.py b/gui/text.py t@@ -10,7 +10,7 @@ from decimal import Decimal import getpass from electrum.util import format_satoshis, set_verbosity -from electrum.bitcoin import is_valid, COIN, TYPE_ADDRESS +from electrum.bitcoin import is_address, COIN, TYPE_ADDRESS from electrum import Wallet, WalletStorage _ = lambda x:x t@@ -320,7 +320,7 @@ class ElectrumGui: self.str_description = '' def do_send(self): - if not is_valid(self.str_recipient): + if not is_address(self.str_recipient): self.show_message(_('Invalid Bitcoin address')) return try: DIR diff --git a/lib/bitcoin.py b/lib/bitcoin.py t@@ -476,11 +476,6 @@ def address_from_private_key(sec): address = public_key_to_p2pkh(bfh(public_key)) return address - -def is_valid(addr): - return is_address(addr) - - def is_address(addr): try: addrtype, h = bc_address_to_hash_160(addr)