electrum

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

commit d944a09da5fc8a4abfd3c503b6d96b2cbe563a9f
parent 6d38c411d1d92d591cdd5c87950a129613f6b1bd
Author: ThomasV <thomasv@electrum.org>
Date:   Sat, 25 Feb 2017 14:56:06 +0100

fixes for Digital Bitbox plugin

Diffstat:
Mplugins/digitalbitbox/digitalbitbox.py | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/plugins/digitalbitbox/digitalbitbox.py b/plugins/digitalbitbox/digitalbitbox.py @@ -374,7 +374,7 @@ class DigitalBitbox_KeyStore(Hardware_KeyStore): if x_pubkey in derivations: index = derivations.get(x_pubkey) inputPath = "%s/%d/%d" % (self.get_derivation(), index[0], index[1]) - inputHash = Hash(tx.tx_for_sig(i).decode('hex')).encode('hex') + inputHash = Hash(tx.serialize_preimage(i).decode('hex')).encode('hex') hasharray_i = {'hash': inputHash, 'keypath': inputPath} hasharray.append(hasharray_i) break @@ -431,10 +431,10 @@ class DigitalBitbox_KeyStore(Hardware_KeyStore): signatures = filter(None, txin['signatures']) if len(signatures) == num: break # txin is complete - ii = txin['pubkeys'].index(pubkey) signed = reply['sign'][i] - assert signed['pubkey'] == pubkey + if signed['pubkey'] != pubkey: + continue sig_r = int(signed['sig'][:64], 16) sig_s = int(signed['sig'][64:], 16) sig = sigencode_der(sig_r, sig_s, generator_secp256k1.order())