mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-01 01:35:20 +00:00
Merge commit 'refs/merge-requests/4' of git://gitorious.org/electrum/electrum into merge-requests/4
This commit is contained in:
commit
829c812f8e
3 changed files with 10 additions and 6 deletions
|
@ -216,7 +216,7 @@ class InvalidPassword(Exception):
|
||||||
|
|
||||||
|
|
||||||
class Wallet:
|
class Wallet:
|
||||||
def __init__(self, wallet_dir):
|
def __init__(self, wallet_dir, wallet_name):
|
||||||
|
|
||||||
self.gap_limit = 5 # configuration
|
self.gap_limit = 5 # configuration
|
||||||
self.host = 'ecdsa.org'
|
self.host = 'ecdsa.org'
|
||||||
|
@ -241,10 +241,10 @@ class Wallet:
|
||||||
self.tx_history = {}
|
self.tx_history = {}
|
||||||
self.rtime = 0
|
self.rtime = 0
|
||||||
|
|
||||||
self.init_path(wallet_dir)
|
self.init_path(wallet_dir, wallet_name)
|
||||||
|
|
||||||
|
|
||||||
def init_path(self, wallet_dir):
|
def init_path(self, wallet_dir, wallet_name):
|
||||||
if wallet_dir is None:
|
if wallet_dir is None:
|
||||||
if "HOME" in os.environ:
|
if "HOME" in os.environ:
|
||||||
wallet_dir = os.path.join( os.environ["HOME"], '.electrum')
|
wallet_dir = os.path.join( os.environ["HOME"], '.electrum')
|
||||||
|
@ -259,7 +259,7 @@ class Wallet:
|
||||||
if not os.path.exists( wallet_dir ):
|
if not os.path.exists( wallet_dir ):
|
||||||
os.mkdir( wallet_dir )
|
os.mkdir( wallet_dir )
|
||||||
|
|
||||||
self.path = os.path.join( wallet_dir, 'electrum.dat')
|
self.path = os.path.join( wallet_dir, wallet_name)
|
||||||
|
|
||||||
def new_seed(self, password):
|
def new_seed(self, password):
|
||||||
seed = "%032x"%ecdsa.util.randrange( pow(2,128) )
|
seed = "%032x"%ecdsa.util.randrange( pow(2,128) )
|
||||||
|
@ -633,6 +633,7 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
parser = OptionParser(usage=usage)
|
parser = OptionParser(usage=usage)
|
||||||
parser.add_option("-d", "--dir", dest="wallet_dir", help="wallet directory")
|
parser.add_option("-d", "--dir", dest="wallet_dir", help="wallet directory")
|
||||||
|
parser.add_option("-w", "--wallet", dest="wallet_name", default="electrum.dat", help="wallet file name (default: electrum.dat)")
|
||||||
parser.add_option("-a", "--all", action="store_true", dest="show_all", default=False, help="show all addresses")
|
parser.add_option("-a", "--all", action="store_true", dest="show_all", default=False, help="show all addresses")
|
||||||
parser.add_option("-b", "--balance", action="store_true", dest="show_balance", default=False, help="show the balance at listed addresses")
|
parser.add_option("-b", "--balance", action="store_true", dest="show_balance", default=False, help="show the balance at listed addresses")
|
||||||
parser.add_option("-k", "--keys",action="store_true", dest="show_keys",default=False, help="show the private keys of listed addresses")
|
parser.add_option("-k", "--keys",action="store_true", dest="show_keys",default=False, help="show the private keys of listed addresses")
|
||||||
|
@ -650,7 +651,7 @@ if __name__ == '__main__':
|
||||||
if cmd not in known_commands:
|
if cmd not in known_commands:
|
||||||
cmd = 'help'
|
cmd = 'help'
|
||||||
|
|
||||||
wallet = Wallet(options.wallet_dir)
|
wallet = Wallet(options.wallet_dir, options.wallet_name)
|
||||||
|
|
||||||
if cmd == 'gui':
|
if cmd == 'gui':
|
||||||
import gui
|
import gui
|
||||||
|
|
|
@ -3,6 +3,7 @@ host = localhost
|
||||||
port = 50000
|
port = 50000
|
||||||
password = secret
|
password = secret
|
||||||
banner = Welcome to Electrum!
|
banner = Welcome to Electrum!
|
||||||
|
irc = yes
|
||||||
|
|
||||||
[database]
|
[database]
|
||||||
type = sqlite3
|
type = sqlite3
|
||||||
|
|
|
@ -39,6 +39,7 @@ config.set('server','banner', 'Welcome to Electrum!')
|
||||||
config.set('server', 'host', 'ecdsa.org')
|
config.set('server', 'host', 'ecdsa.org')
|
||||||
config.set('server', 'port', 50000)
|
config.set('server', 'port', 50000)
|
||||||
config.set('server', 'password', '')
|
config.set('server', 'password', '')
|
||||||
|
config.set('server', 'irc', 'yes')
|
||||||
config.add_section('database')
|
config.add_section('database')
|
||||||
config.set('database', 'type', 'psycopg2')
|
config.set('database', 'type', 'psycopg2')
|
||||||
config.set('database', 'database', 'abe')
|
config.set('database', 'database', 'abe')
|
||||||
|
@ -519,6 +520,7 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
thread.start_new_thread(listen_thread, (store,))
|
thread.start_new_thread(listen_thread, (store,))
|
||||||
thread.start_new_thread(clean_session_thread, ())
|
thread.start_new_thread(clean_session_thread, ())
|
||||||
|
if (config.get('server','irc') == 'yes' ):
|
||||||
thread.start_new_thread(irc_thread, ())
|
thread.start_new_thread(irc_thread, ())
|
||||||
|
|
||||||
while not stopping:
|
while not stopping:
|
||||||
|
|
Loading…
Add table
Reference in a new issue