cleanup
This commit is contained in:
parent
4c9673849f
commit
be7de01bf7
|
@ -17,7 +17,7 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
import sys, base64, os, re, hashlib, copy, operator, ast, threading
|
import sys, base64, os, re, hashlib, copy, operator, ast, threading, random
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import ecdsa
|
import ecdsa
|
||||||
|
@ -230,6 +230,8 @@ def format_satoshis(x, is_diff=False):
|
||||||
|
|
||||||
|
|
||||||
from version import ELECTRUM_VERSION, SEED_VERSION
|
from version import ELECTRUM_VERSION, SEED_VERSION
|
||||||
|
from interface import NativeInterface, AsynchronousInterface, HttpInterface, DEFAULT_SERVERS
|
||||||
|
|
||||||
|
|
||||||
DEFAULT_PORT = 50000
|
DEFAULT_PORT = 50000
|
||||||
|
|
||||||
|
@ -259,6 +261,9 @@ class Wallet:
|
||||||
self.receipt = None # next receipt
|
self.receipt = None # next receipt
|
||||||
self.addressbook = [] # outgoing addresses, for payments
|
self.addressbook = [] # outgoing addresses, for payments
|
||||||
|
|
||||||
|
self.host = random.choice( DEFAULT_SERVERS ) # random choice when the wallet is created
|
||||||
|
self.port = DEFAULT_PORT
|
||||||
|
|
||||||
# not saved
|
# not saved
|
||||||
self.tx_history = {}
|
self.tx_history = {}
|
||||||
|
|
||||||
|
@ -523,7 +528,6 @@ class Wallet:
|
||||||
'fee':self.fee,
|
'fee':self.fee,
|
||||||
'host':self.host,
|
'host':self.host,
|
||||||
'port':self.port,
|
'port':self.port,
|
||||||
#'blocks':self.interface.blocks,
|
|
||||||
'seed':self.seed,
|
'seed':self.seed,
|
||||||
'addresses':self.addresses,
|
'addresses':self.addresses,
|
||||||
'change_addresses':self.change_addresses,
|
'change_addresses':self.change_addresses,
|
||||||
|
@ -550,8 +554,6 @@ class Wallet:
|
||||||
data = f.read()
|
data = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
except:
|
except:
|
||||||
self.host = ''
|
|
||||||
self.port = DEFAULT_PORT
|
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
d = ast.literal_eval( data )
|
d = ast.literal_eval( data )
|
||||||
|
@ -972,12 +974,6 @@ class Wallet:
|
||||||
self.handle_response(response)
|
self.handle_response(response)
|
||||||
|
|
||||||
def start_interface(self):
|
def start_interface(self):
|
||||||
from interface import NativeInterface, AsynchronousInterface, HttpInterface, DEFAULT_SERVERS
|
|
||||||
import random
|
|
||||||
|
|
||||||
if not self.host:
|
|
||||||
self.host = random.choice( DEFAULT_SERVERS ) # random choice when the wallet is created
|
|
||||||
|
|
||||||
if self.port == 50000:
|
if self.port == 50000:
|
||||||
InterfaceClass = NativeInterface
|
InterfaceClass = NativeInterface
|
||||||
elif self.port == 50001:
|
elif self.port == 50001:
|
||||||
|
|
Loading…
Reference in New Issue