commit b9da5afa9d3848843a0c7944bdcbf99d5ba51421
parent e853dde1113f5d3fb96b864aca283781abbd6f8e
Author: ThomasV <thomasv@electrum.org>
Date: Thu, 31 Aug 2017 10:06:13 +0200
replace bitcoin.is_valid
Diffstat:
4 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py
@@ -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,
@@ -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
diff --git a/gui/stdio.py b/gui/stdio.py
@@ -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
@@ -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:
diff --git a/gui/text.py b/gui/text.py
@@ -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
@@ -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:
diff --git a/lib/bitcoin.py b/lib/bitcoin.py
@@ -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)