fix: replace remaining occurences of public_key_to_bc_address

This commit is contained in:
ThomasV 2017-01-29 06:34:35 +01:00
parent f937472928
commit 6bfbc9a718
4 changed files with 6 additions and 6 deletions

View file

@ -404,7 +404,7 @@ def public_key_from_private_key(sec):
def address_from_private_key(sec):
public_key = public_key_from_private_key(sec)
address = public_key_to_bc_address(public_key.decode('hex'))
address = public_key_to_p2pkh(public_key.decode('hex'))
return address
@ -470,7 +470,7 @@ def verify_message(address, sig, message):
public_key, compressed = pubkey_from_signature(sig, message)
# check public key using the address
pubkey = point_to_ser(public_key.pubkey.point, compressed)
addr = public_key_to_bc_address(pubkey)
addr = public_key_to_p2pkh(pubkey)
if address != addr:
raise Exception("Bad signature")
# check message

View file

@ -820,7 +820,7 @@ class Transaction:
if type == TYPE_ADDRESS:
addr = x
elif type == TYPE_PUBKEY:
addr = public_key_to_bc_address(x.decode('hex'))
addr = bitcoin.public_key_to_p2pkh(x.decode('hex'))
else:
addr = 'SCRIPT ' + x.encode('hex')
o.append((addr,v)) # consider using yield (addr, v)

View file

@ -619,7 +619,7 @@ class Abstract_Wallet(PrintError):
if _type == TYPE_ADDRESS:
addr = x
elif _type == TYPE_PUBKEY:
addr = public_key_to_bc_address(x.decode('hex'))
addr = bitcoin.public_key_to_p2pkh(x.decode('hex'))
else:
addr = None
if addr and self.is_mine(addr):

View file

@ -6,7 +6,7 @@ from binascii import hexlify, unhexlify
from functools import partial
from electrum.bitcoin import (bc_address_to_hash_160, xpub_from_pubkey,
public_key_to_bc_address, EncodeBase58Check,
public_key_to_p2pkh, EncodeBase58Check,
TYPE_ADDRESS, TYPE_SCRIPT)
from electrum.i18n import _
from electrum.plugins import BasePlugin, hook
@ -29,7 +29,7 @@ class TrezorCompatibleKeyStore(Hardware_KeyStore):
def decrypt_message(self, pubkey, message, password):
raise RuntimeError(_('Electrum and %s encryption and decryption are currently incompatible') % self.device)
address = public_key_to_bc_address(pubkey.decode('hex'))
address = public_key_to_p2pkh(pubkey.decode('hex'))
client = self.get_client()
address_path = self.address_id(address)
address_n = client.expand_path(address_path)