diff --git a/app/src/main/java/cy/agorise/crystalwallet/manager/GeneralAccountManager.java b/app/src/main/java/cy/agorise/crystalwallet/manager/GeneralAccountManager.java index d7df4fc..08c2e90 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/manager/GeneralAccountManager.java +++ b/app/src/main/java/cy/agorise/crystalwallet/manager/GeneralAccountManager.java @@ -98,7 +98,7 @@ public class GeneralAccountManager implements CryptoAccountManager, CryptoNetInf CryptoCoinBalance balance = new CryptoCoinBalance(); balance.setBalance(0); - balance.setCryptoCurrencyId(db.cryptoCurrencyDao().getByName(cryptoCoin.name(),cryptoCoin.name()).getId()); + balance.setCryptoCurrencyId(db.cryptoCurrencyDao().getByName(cryptoCoin.getLabel(),cryptoCoin.name()).getId()); balance.setAccountId(account.getId()); db.cryptoCoinBalanceDao().insertCryptoCoinBalance(balance); @@ -495,7 +495,7 @@ public class GeneralAccountManager implements CryptoAccountManager, CryptoNetInf } private void calculateUri(CalculateBitcoinUriRequest request) { - StringBuilder uri = new StringBuilder(this.cryptoCoin.getLabel().toLowerCase()+":"); + StringBuilder uri = new StringBuilder(this.cryptoCoin.name().toLowerCase()+":"); CrystalDatabase db = CrystalDatabase.getAppDatabase(request.getContext()); long index = db.bitcoinAddressDao().getLastExternalAddress(request.getAccount().getId()); @@ -530,6 +530,8 @@ public class GeneralAccountManager implements CryptoAccountManager, CryptoNetInf uri.append(request.getAmount()); } + System.out.println("GeneralAccountMAnager uri calculated : " + uri.toString()); + request.setUri(uri.toString()); request.validate(); } diff --git a/app/src/main/java/cy/agorise/crystalwallet/models/BitcoinAddress.java b/app/src/main/java/cy/agorise/crystalwallet/models/BitcoinAddress.java index ac076f7..f8ca2bd 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/models/BitcoinAddress.java +++ b/app/src/main/java/cy/agorise/crystalwallet/models/BitcoinAddress.java @@ -12,7 +12,7 @@ import android.support.annotation.NonNull; */ @Entity( tableName="bitcoin_address", - primaryKeys = {"account_id","address_index"}, + primaryKeys = {"account_id","address_index","is_change"}, foreignKeys = { @ForeignKey( entity = CryptoNetAccount.class,