@@ -255,11 +255,12 @@ def send():
255
255
unlock_account_form = UnlockAccountForm ()
256
256
create_account_form = CreateAccountForm ()
257
257
send_ether_form = SendEtherForm ()
258
+ form_create_multiple = CreateMultipleAccountsForm ()
258
259
if request .method == 'GET' :
259
260
if not unlocked :
260
261
if not os .path .exists ("accounts.json" ):
261
262
flash ("No accounts exist, please create an account." , 'warning' )
262
- return render_template ('create.html' , account = "new" , create_account_form = create_account_form )
263
+ return render_template ('create.html' , account = "new" , create_account_form = create_account_form , form_create_multiple = form_create_multiple )
263
264
else :
264
265
return render_template ('unlock.html' , account = "current" , unlock_account_form = unlock_account_form , year = year )
265
266
if os .path .exists ("accounts.json" ):
@@ -333,11 +334,17 @@ def createlootbundle():
333
334
global unlocked
334
335
if request .method == 'GET' :
335
336
if not unlocked :
336
- with open ('accounts.json' , 'r' ) as accounts_from_file :
337
- account_data_json = json .load (accounts_from_file )
338
- pub_address = account_data_json [int (0 )]['public_address' ]
339
- private_key = account_data_json [int (0 )]['private_key' ]
340
- mnemonic_phrase = account_data_json [int (0 )]['mnemonic_phrase' ]
337
+ try :
338
+ with open ('accounts.json' , 'r' ) as accounts_from_file :
339
+ account_data_json = json .load (accounts_from_file )
340
+ pub_address = account_data_json [int (0 )]['public_address' ]
341
+ private_key = account_data_json [int (0 )]['private_key' ]
342
+ mnemonic_phrase = account_data_json [int (0 )]['mnemonic_phrase' ]
343
+ except Exception :
344
+ create_account_form = CreateAccountForm ()
345
+ form_create_multiple = CreateMultipleAccountsForm ()
346
+ return render_template ('create.html' , account = "new" , create_account_form = create_account_form ,
347
+ form_create_multiple = form_create_multiple )
341
348
return render_template ('unlock.html' , account = "current" , pub_address = pub_address ,
342
349
private_key = private_key , mnemonic_phrase = mnemonic_phrase , unlock_account_form = unlock_account_form , year = year )
343
350
if unlocked :
0 commit comments