Browse Source

requests: store path not url

283
ThomasV 10 years ago
parent
commit
2727df962e
  1. 5
      lib/commands.py
  2. 2
      lib/wallet.py

5
lib/commands.py

@ -510,13 +510,14 @@ class Commands:
def listrequests(self):
"""List the payment requests you made"""
out = []
for addr, v in self.wallet.receive_requests.items():
for k, v in self.wallet.receive_requests.items():
out.append({
'address': addr,
'address': v.get('address'),
'amount': format_satoshis(v.get('amount')),
'time': v.get('time'),
'reason': self.wallet.get_label(addr)[0],
'expiration': v.get('expiration'),
'url': 'bitcoin:?r=file://' + v.get('path'),
})
return out

2
lib/wallet.py

@ -1260,7 +1260,7 @@ class Abstract_Wallet(object):
path = os.path.join(rdir, addr + '.bip70')
with open(path, 'w') as f:
f.write(pr)
r['url'] = 'bitcoin:?r=file://' + path
r['path'] = path
self.receive_requests[addr] = r
self.storage.put('receive_requests2', self.receive_requests)

Loading…
Cancel
Save