electrum

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

commit 737a7f0bfbfd2b674f3af2ecfcc1a411f0cadb2e
parent ded07132d264e140dac1e89136bed58e0b192b14
Author: ThomasV <thomasv@electrum.org>
Date:   Mon, 20 Mar 2017 10:47:03 +0100

fix #2302: signing with imported wallet

Diffstat:
Mlib/transaction.py | 8++++----
Mlib/wallet.py | 2+-
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/transaction.py b/lib/transaction.py @@ -652,6 +652,8 @@ class Transaction: elif _type == 'p2wpkh-p2sh': redeem_script = segwit_script(pubkeys[0]) return push_script(redeem_script) + elif _type == 'address': + script += push_script(pubkeys[0]) else: raise TypeError('Unknown txin type', _type) return script @@ -822,12 +824,10 @@ class Transaction: if len(signatures) == num: # txin is complete break - fd_key = 'fd00' + bitcoin.hash_160(pubkeys[j].decode('hex')).encode('hex') - if x_pubkey in keypairs.keys() or fd_key in keypairs.keys(): + if x_pubkey in keypairs.keys(): print_error("adding signature for", x_pubkey) - sec = keypairs.get(x_pubkey) or keypairs.get(fd_key) + sec = keypairs.get(x_pubkey) pubkey = public_key_from_private_key(sec) - assert pubkey == pubkeys[j] # add signature pre_hash = Hash(self.serialize_preimage(i).decode('hex')) pkey = regenerate_key(sec) diff --git a/lib/wallet.py b/lib/wallet.py @@ -1320,7 +1320,7 @@ class Imported_Wallet(Abstract_Wallet): # wallet made of imported addresses wallet_type = 'imported' - txin_type = 'unknown' + txin_type = 'address' def __init__(self, storage): Abstract_Wallet.__init__(self, storage)