tmove seed generation function to bitcoin.py - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 5da3cab24b2a9b93e92f2febf0cae43d7287763c DIR parent bd717897e0cc53a3888288349dd15a19252f4994 HTML Author: thomasv <thomasv@gitorious> Date: Sun, 24 Feb 2013 10:16:14 +0100 move seed generation function to bitcoin.py Diffstat: M lib/bitcoin.py | 4 ++++ M lib/wallet.py | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) --- DIR diff --git a/lib/bitcoin.py b/lib/bitcoin.py t@@ -348,6 +348,10 @@ class EC_KEY(object): ###################################### BIP32 ############################## +random_seed = lambda n: "%032x"%ecdsa.util.randrange( pow(2,n) ) + + + def bip32_init(seed): import hmac DIR diff --git a/lib/wallet.py b/lib/wallet.py t@@ -27,11 +27,9 @@ import ast import threading import random import aes -import ecdsa import Queue import time -from ecdsa.util import string_to_number, number_to_string from util import print_msg, print_error, user_dir, format_satoshis from bitcoin import * t@@ -160,7 +158,7 @@ class Wallet: def init_seed(self, seed): if self.seed: raise BaseException("a seed exists") if not seed: - seed = "%032x"%ecdsa.util.randrange( pow(2,128) ) + seed = random_seed(128) self.seed = seed self.config.set_key('seed', self.seed, True) self.config.set_key('seed_version', self.seed_version, True)