From 51295b9edece79eea08f63015d0571c244039d6e Mon Sep 17 00:00:00 2001 From: Marat Subkhankulov Date: Sat, 28 Oct 2017 20:50:25 -0700 Subject: [PATCH] Fix DEADBEEF account bug --- .../com/wallet/crypto/trustapp/controller/Controller.java | 6 ++++-- .../crypto/trustapp/views/TransactionListActivity.java | 3 --- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/wallet/crypto/trustapp/controller/Controller.java b/app/src/main/java/com/wallet/crypto/trustapp/controller/Controller.java index 2adc7f191..f19f4f51a 100644 --- a/app/src/main/java/com/wallet/crypto/trustapp/controller/Controller.java +++ b/app/src/main/java/com/wallet/crypto/trustapp/controller/Controller.java @@ -147,9 +147,11 @@ public class Controller { mCurrentAddress = null; if (mAccounts.size() > 0) { - mCurrentAddress = mPreferences.getString(PREF_CURRENT_ADDRESS, null); - if (mCurrentAddress == null) { + String cachedAddress = mPreferences.getString(PREF_CURRENT_ADDRESS, null); + if (getAccount(cachedAddress) == null) { setCurrentAddress(mAccounts.get(0).getAddress()); + } else { + setCurrentAddress(cachedAddress); } } diff --git a/app/src/main/java/com/wallet/crypto/trustapp/views/TransactionListActivity.java b/app/src/main/java/com/wallet/crypto/trustapp/views/TransactionListActivity.java index 4c485930c..584411019 100644 --- a/app/src/main/java/com/wallet/crypto/trustapp/views/TransactionListActivity.java +++ b/app/src/main/java/com/wallet/crypto/trustapp/views/TransactionListActivity.java @@ -111,9 +111,6 @@ public class TransactionListActivity extends AppCompatActivity { if (account != null) { mAddress = account.getAddress(); Log.d(TAG, "Address: %s, Balance: %s".format(mAddress, account.getBalance().toString())); - } else { - mAddress ="0xDEADBEEF"; - account = new VMAccount(mAddress, "0"); } Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);