Browse Source

revert previous; fix qr code for make_address

283
ThomasV 13 years ago
parent
commit
0e4c51494b
  1. 20
      electrum4a.py

20
electrum4a.py

@ -20,10 +20,10 @@
import android import android
import lib as electrum
from electrum import WalletSynchronizer, Wallet, format_satoshis from interface import WalletSynchronizer
from electrum import mnemonic from wallet import Wallet, format_satoshis
import mnemonic
from decimal import Decimal from decimal import Decimal
import datetime, re import datetime, re
@ -536,14 +536,20 @@ def make_new_contact():
code = droid.scanBarcode() code = droid.scanBarcode()
r = code.result r = code.result
if r: if r:
address = r['extras']['SCAN_RESULT'] data = r['extras']['SCAN_RESULT']
if address: if data:
if wallet.is_valid(address): if re.match('^bitcoin:', data):
address, _, _, _, _, _, _ = wallet.parse_url(data, None, None)
elif wallet.is_valid(data):
address = data
else:
address = None
if address:
if modal_question('Add to contacts?', address): if modal_question('Add to contacts?', address):
wallet.addressbook.append(address) wallet.addressbook.append(address)
wallet.save() wallet.save()
else: else:
modal_dialog('Invalid address', address) modal_dialog('Invalid address', data)
do_refresh = False do_refresh = False

Loading…
Cancel
Save