electrum

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

commit 66e1e2707d4a82ecbe3f2bf7d532036d0a9651a8
parent 2be8c7f7edb21df4978a6a68040af3a8eecbb7e6
Author: ThomasV <thomasv@gitorious>
Date:   Thu,  3 Apr 2014 16:11:28 +0200

get_pubkey_from_x

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

diff --git a/lib/account.py b/lib/account.py @@ -140,27 +140,30 @@ class BIP32_Account(Account): return d def get_address(self, for_change, n): - pubkey = self.get_pubkey(self.xpub, for_change, n) + pubkey = self.get_pubkey(for_change, n) address = public_key_to_bc_address( pubkey.decode('hex') ) return address def first_address(self): return self.get_address(0,0) - def get_pubkey(self, xpub, for_change, n): + def get_master_pubkeys(self): + return [self.xpub] + + def get_pubkey_from_x(self, xpub, for_change, n): _, _, _, c, cK = deserialize_xkey(xpub) for i in [for_change, n]: cK, c = CKD_pub(cK, c, i) return cK.encode('hex') - def redeem_script(self, sequence): - return None - def get_pubkeys(self, sequence): - return sorted(map(lambda x: self.get_pubkey(x, *sequence ), self.get_master_pubkeys())) + return sorted(map(lambda x: self.get_pubkey_from_x(x, *sequence), self.get_master_pubkeys())) - def get_master_pubkeys(self): - return [self.xpub] + def get_pubkey(self, for_change, n): + return self.get_pubkeys((for_change, n))[0] + + def redeem_script(self, sequence): + return None def get_type(self): return _('Standard 1 of 1')