replace bitcoin.is_valid
This commit is contained in:
@@ -42,7 +42,7 @@ from electrum.util import bh2u, bfh
|
|||||||
from . import icons_rc
|
from . import icons_rc
|
||||||
|
|
||||||
from electrum import keystore
|
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.plugins import run_hook
|
||||||
from electrum.i18n import _
|
from electrum.i18n import _
|
||||||
from electrum.util import (format_time, format_satoshis, PrintError,
|
from electrum.util import (format_time, format_satoshis, PrintError,
|
||||||
@@ -1619,7 +1619,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
|||||||
self.payto_e.setFocus()
|
self.payto_e.setFocus()
|
||||||
|
|
||||||
def set_contact(self, label, address):
|
def set_contact(self, label, address):
|
||||||
if not is_valid(address):
|
if not is_address(address):
|
||||||
self.show_error(_('Invalid Address'))
|
self.show_error(_('Invalid Address'))
|
||||||
self.contact_list.update() # Displays original unchanged value
|
self.contact_list.update() # Displays original unchanged value
|
||||||
return False
|
return False
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ _ = lambda x:x
|
|||||||
#from i18n import _
|
#from i18n import _
|
||||||
from electrum import WalletStorage, Wallet
|
from electrum import WalletStorage, Wallet
|
||||||
from electrum.util import format_satoshis, set_verbosity
|
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
|
from electrum.network import filter_protocol
|
||||||
import sys, getpass, datetime
|
import sys, getpass, datetime
|
||||||
|
|
||||||
@@ -169,7 +169,7 @@ class ElectrumGui:
|
|||||||
while self.done == 0: self.main_command()
|
while self.done == 0: self.main_command()
|
||||||
|
|
||||||
def do_send(self):
|
def do_send(self):
|
||||||
if not is_valid(self.str_recipient):
|
if not is_address(self.str_recipient):
|
||||||
print(_('Invalid Bitcoin address'))
|
print(_('Invalid Bitcoin address'))
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ from decimal import Decimal
|
|||||||
import getpass
|
import getpass
|
||||||
|
|
||||||
from electrum.util import format_satoshis, set_verbosity
|
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
|
from electrum import Wallet, WalletStorage
|
||||||
|
|
||||||
_ = lambda x:x
|
_ = lambda x:x
|
||||||
@@ -320,7 +320,7 @@ class ElectrumGui:
|
|||||||
self.str_description = ''
|
self.str_description = ''
|
||||||
|
|
||||||
def do_send(self):
|
def do_send(self):
|
||||||
if not is_valid(self.str_recipient):
|
if not is_address(self.str_recipient):
|
||||||
self.show_message(_('Invalid Bitcoin address'))
|
self.show_message(_('Invalid Bitcoin address'))
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -476,11 +476,6 @@ def address_from_private_key(sec):
|
|||||||
address = public_key_to_p2pkh(bfh(public_key))
|
address = public_key_to_p2pkh(bfh(public_key))
|
||||||
return address
|
return address
|
||||||
|
|
||||||
|
|
||||||
def is_valid(addr):
|
|
||||||
return is_address(addr)
|
|
||||||
|
|
||||||
|
|
||||||
def is_address(addr):
|
def is_address(addr):
|
||||||
try:
|
try:
|
||||||
addrtype, h = bc_address_to_hash_160(addr)
|
addrtype, h = bc_address_to_hash_160(addr)
|
||||||
|
|||||||
Reference in New Issue
Block a user