electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 8995cdbf1429a790d9f3eda81382dc972b0cffa9
parent 357c405ac66435c32bd353445c52d139b8165cf5
Author: ThomasV <thomasv@gitorious>
Date:   Mon,  8 Jun 2015 13:36:35 +0200

rename fields: 'time' -> 'timestamp', payment_requests

Diffstat:
Mgui/qt/main_window.py | 6+++---
Mlib/paymentrequest.py | 2+-
Mlib/wallet.py | 12++++++------
3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py @@ -668,7 +668,7 @@ class ElectrumWindow(QMainWindow): return addr = str(item.text(2)) req = self.wallet.receive_requests[addr] - expires = _('Never') if req.get('expiration') is None else format_time(req['time'] + req['expiration']) + expires = _('Never') if req.get('expiration') is None else format_time(req['timestamp'] + req['expiration']) amount = req['amount'] message = self.wallet.labels.get(addr, '') self.receive_address_e.setText(addr) @@ -696,7 +696,7 @@ class ElectrumWindow(QMainWindow): item = self.receive_list.itemAt(position) addr = str(item.text(2)) req = self.wallet.receive_requests[addr] - time, amount = req['time'], req['amount'] + time, amount = req['timestamp'], req['amount'] message = self.wallet.labels.get(addr, '') URI = util.create_URI(addr, amount, message) menu = QMenu() @@ -809,7 +809,7 @@ class ElectrumWindow(QMainWindow): address = req['address'] if address not in domain: continue - timestamp = req['time'] + timestamp = req['timestamp'] amount = req.get('amount') expiration = req.get('expiration', None) message = req.get('memo', '') diff --git a/lib/paymentrequest.py b/lib/paymentrequest.py @@ -296,7 +296,7 @@ def make_payment_request(outputs, memo, time, expires, key_path, cert_path): def make_request(config, req): from transaction import Transaction addr = req['address'] - time = req['time'] + time = req['timestamp'] amount = req['amount'] expiration = req['expiration'] message = req['memo'] diff --git a/lib/wallet.py b/lib/wallet.py @@ -165,7 +165,7 @@ class Abstract_Wallet(object): self.load_transactions() # load requests - self.receive_requests = self.storage.get('receive_requests2', {}) + self.receive_requests = self.storage.get('payment_requests', {}) # spv self.verifier = None @@ -1258,7 +1258,7 @@ class Abstract_Wallet(object): r = self.receive_requests[key] address = r['address'] amount = r.get('amount') - timestamp = r.get('time') + timestamp = r.get('timestamp', 0) expiration = r.get('expiration') if amount: paid = amount <= self.get_addr_received(address) @@ -1273,9 +1273,9 @@ class Abstract_Wallet(object): import paymentrequest, shutil, os timestamp = int(time.time()) _id = Hash(addr + "%d"%timestamp).encode('hex')[0:10] - r = {'time':timestamp, 'amount':amount, 'expiration':expiration, 'address':addr, 'memo':message, 'id':_id} + r = {'timestamp':timestamp, 'amount':amount, 'expiration':expiration, 'address':addr, 'memo':message, 'id':_id} self.receive_requests[addr] = r - self.storage.put('receive_requests2', self.receive_requests) + self.storage.put('payment_requests', self.receive_requests) self.set_label(addr, message) # should be a default label rdir = config.get('requests_dir') req = self.get_payment_request(addr, config) @@ -1308,11 +1308,11 @@ class Abstract_Wallet(object): n = os.path.join(rdir, key + s) if os.path.exists(n): os.unlink(n) - self.storage.put('receive_requests2', self.receive_requests) + self.storage.put('payment_requests', self.receive_requests) return True def get_sorted_requests(self, config): - return sorted(map(lambda x: self.get_payment_request(x, config), self.receive_requests.keys()), key=itemgetter('time')) + return sorted(map(lambda x: self.get_payment_request(x, config), self.receive_requests.keys()), key=itemgetter('timestamp'))