|
|
|
@ -29,7 +29,7 @@ import json |
|
|
|
import copy |
|
|
|
import copy |
|
|
|
import re |
|
|
|
import re |
|
|
|
import stat |
|
|
|
import stat |
|
|
|
import hmac, hashlib |
|
|
|
import hashlib |
|
|
|
import base64 |
|
|
|
import base64 |
|
|
|
import zlib |
|
|
|
import zlib |
|
|
|
from collections import defaultdict |
|
|
|
from collections import defaultdict |
|
|
|
@ -73,7 +73,7 @@ class JsonDB(PrintError): |
|
|
|
def __init__(self, path): |
|
|
|
def __init__(self, path): |
|
|
|
self.db_lock = threading.RLock() |
|
|
|
self.db_lock = threading.RLock() |
|
|
|
self.data = {} |
|
|
|
self.data = {} |
|
|
|
self.path = path |
|
|
|
self.path = os.path.normcase(os.path.abspath(path)) |
|
|
|
self.modified = False |
|
|
|
self.modified = False |
|
|
|
|
|
|
|
|
|
|
|
def get(self, key, default=None): |
|
|
|
def get(self, key, default=None): |
|
|
|
@ -142,8 +142,8 @@ class JsonDB(PrintError): |
|
|
|
class WalletStorage(JsonDB): |
|
|
|
class WalletStorage(JsonDB): |
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, path, manual_upgrades=False): |
|
|
|
def __init__(self, path, manual_upgrades=False): |
|
|
|
self.print_error("wallet path", path) |
|
|
|
|
|
|
|
JsonDB.__init__(self, path) |
|
|
|
JsonDB.__init__(self, path) |
|
|
|
|
|
|
|
self.print_error("wallet path", path) |
|
|
|
self.manual_upgrades = manual_upgrades |
|
|
|
self.manual_upgrades = manual_upgrades |
|
|
|
self.pubkey = None |
|
|
|
self.pubkey = None |
|
|
|
if self.file_exists(): |
|
|
|
if self.file_exists(): |
|
|
|
|