1
0

deprecate wallet.save() and 'eval' command

This commit is contained in:
ecdsa
2013-05-02 10:54:48 +02:00
parent 6be62e44de
commit b2c23f9ac8
4 changed files with 22 additions and 16 deletions

View File

@@ -336,7 +336,8 @@ class Wallet:
self.accounts[key][0] = addresses
self.gap_limit = value
self.save()
self.config.set_key('gap_limit', self.gap_limit, True)
self.config.set_key('accounts', self.accounts, True)
return True
else:
return False
@@ -405,6 +406,9 @@ class Wallet:
new = []
for account in self.accounts.keys():
new += self.synchronize_account(account)
if new:
self.config.set_key('accounts', self.accounts, True)
self.config.set_key('addr_history', self.history, True)
return new
@@ -670,11 +674,17 @@ class Wallet:
with self.transaction_lock:
self.transactions[tx_hash] = tx
self.save_transactions()
if self.verifier and tx_height>0:
self.verifier.add(tx_hash, tx_height)
self.update_tx_outputs(tx_hash)
self.save()
def save_transactions(self):
tx = {}
for k,v in self.transactions.items():
tx[k] = str(v)
self.config.set_key('transactions', tx, True)
def receive_history_callback(self, addr, hist):
@@ -684,7 +694,7 @@ class Wallet:
with self.lock:
self.history[addr] = hist
self.save()
self.config.set_key('addr_history', history, True)
if hist != ['*']:
for tx_hash, tx_height in hist:
@@ -893,6 +903,7 @@ class Wallet:
def save(self):
print_error("Warning: wallet.save() is deprecated")
tx = {}
for k,v in self.transactions.items():
tx[k] = str(v)