electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 6bfbc9a718b938d239932a5ca6bc912fdec28f51
parent f937472928a641cba55e8e9767802086374e58c2
Author: ThomasV <thomasv@electrum.org>
Date:   Sun, 29 Jan 2017 06:34:35 +0100

fix: replace remaining occurences of public_key_to_bc_address

Diffstat:
Mlib/bitcoin.py | 4++--
Mlib/transaction.py | 2+-
Mlib/wallet.py | 2+-
Mplugins/trezor/plugin.py | 4++--
4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/bitcoin.py b/lib/bitcoin.py @@ -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 diff --git a/lib/transaction.py b/lib/transaction.py @@ -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) diff --git a/lib/wallet.py b/lib/wallet.py @@ -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): diff --git a/plugins/trezor/plugin.py b/plugins/trezor/plugin.py @@ -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)