electrum

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

commit 05fcdce018570df7b8815f6141c653e13da677c0
parent 9fccf9c2871a423e7b46d9a5d021a1f165707504
Author: ThomasV <thomasv@gitorious>
Date:   Tue,  1 Apr 2014 19:10:35 +0200

fix redeem scripts

Diffstat:
Mlib/account.py | 13++-----------
1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/lib/account.py b/lib/account.py @@ -181,10 +181,8 @@ class BIP32_Account_2of2(BIP32_Account): return cK.encode('hex') def redeem_script(self, sequence): - chain, i = sequence - pubkey1 = self.get_pubkey(chain, i) - pubkey2 = self.get_pubkey2(chain, i) - return Transaction.multisig_script([pubkey1, pubkey2], 2) + pubkeys = self.get_pubkeys(sequence) + return Transaction.multisig_script(pubkeys, len(pubkeys)) def get_address(self, for_change, n): address = hash_160_to_bc_address(hash_160(self.redeem_script((for_change, n)).decode('hex')), 5) @@ -217,13 +215,6 @@ class BIP32_Account_2of3(BIP32_Account_2of2): cK, c = CKD_pub(cK, c, i) return cK.encode('hex') - def get_redeem_script(self, sequence): - chain, i = sequence - pubkey1 = self.get_pubkey(chain, i) - pubkey2 = self.get_pubkey2(chain, i) - pubkey3 = self.get_pubkey3(chain, i) - return Transaction.multisig_script([pubkey1, pubkey2, pubkey3], 3) - def get_pubkeys(self, sequence): return [ self.get_pubkey( *sequence ), self.get_pubkey2( *sequence ), self.get_pubkey3( *sequence )]