diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index ff1beb34b..03c14274c 100644 Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ diff --git a/app/build.gradle b/app/build.gradle index 3dd1f6877..dce6e6283 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId = 'com.wagerrwallet' minSdkVersion 23 targetSdkVersion 28 - versionCode 279 - versionName "279" + versionCode 280 + versionName "280" multiDexEnabled true // Similar to other properties in the defaultConfig block, diff --git a/app/src/main/java/com/wagerrwallet/tools/sqlite/BetMappingTxDataStore.java b/app/src/main/java/com/wagerrwallet/tools/sqlite/BetMappingTxDataStore.java index 89bb6cab8..fb2c2c006 100644 --- a/app/src/main/java/com/wagerrwallet/tools/sqlite/BetMappingTxDataStore.java +++ b/app/src/main/java/com/wagerrwallet/tools/sqlite/BetMappingTxDataStore.java @@ -272,6 +272,26 @@ public void deleteTxByHash(Context app, String iso, String hash) { } } + public void deleteDuplicateMappings(Context app) { + Cursor cursor = null; + try { + database = openDatabase(); + Log.e(TAG, "mapping transaction deleted" ); + String QUERY = "delete from "+BRSQLiteHelper.BMTX_TABLE_NAME+" where " + BRSQLiteHelper.BMTX_COLUMN_ID + " in (select " + BRSQLiteHelper.BMTX_COLUMN_ID + " " + + "from "+BRSQLiteHelper.BMTX_TABLE_NAME+" where "+ BRSQLiteHelper.BMTX_MAPPINGID +" in " + + "(select "+ BRSQLiteHelper.BMTX_MAPPINGID +" from "+BRSQLiteHelper.BMTX_TABLE_NAME+" where " + BRSQLiteHelper.BMTX_NAMESPACEID +"=3 " + + "group by " + BRSQLiteHelper.BMTX_NAMESPACEID + ", " + BRSQLiteHelper.BMTX_MAPPINGID + " " + + "having count(*)>1) " + + "and " + BRSQLiteHelper.BMTX_COLUMN_ID + " not in (select max(" + BRSQLiteHelper.BMTX_COLUMN_ID + ") from "+BRSQLiteHelper.BMTX_TABLE_NAME+" where "+ BRSQLiteHelper.BMTX_NAMESPACEID +"=3 " + + "group by " + BRSQLiteHelper.BMTX_NAMESPACEID + ", " + BRSQLiteHelper.BMTX_MAPPINGID + " " + + "having count(*)>1) )"; + + database.rawQuery(QUERY, null); + } finally { + closeDatabase(); + } + } + public class BetMappingDupItem { public long NamespaceID; public long MappingID; diff --git a/app/src/main/java/com/wagerrwallet/wallet/wallets/wagerr/WalletWagerrManager.java b/app/src/main/java/com/wagerrwallet/wallet/wallets/wagerr/WalletWagerrManager.java index 255c034a2..fa9a57f62 100644 --- a/app/src/main/java/com/wagerrwallet/wallet/wallets/wagerr/WalletWagerrManager.java +++ b/app/src/main/java/com/wagerrwallet/wallet/wallets/wagerr/WalletWagerrManager.java @@ -304,11 +304,15 @@ public List getTxUiHolders() { } protected void CleanChainBugs(Context app) { + BetMappingTxDataStore bm = BetMappingTxDataStore.getInstance(app); // fake team mappings for ID 187. - BetMappingTxDataStore.getInstance(app).deleteTxByHash(app,"wgr", "cc89779e8e57d49e5e6d3e16ad57e648b19d86fb8f4714bc7df5abd3f92daa1d"); - BetMappingTxDataStore.getInstance(app).deleteTxByHash(app,"wgr", "d8e1e8389bbcffe1c79cf11e2206281377e54b99219ec6ccec296c2adb8ad65f"); - BetMappingTxDataStore.getInstance(app).deleteTxByHash(app,"wgr", "929972a7b2fdf55f6da7488ccaf7312fd5d22c4bca003ca089293c93f1c32917"); - BetMappingTxDataStore.getInstance(app).deleteTxByHash(app,"wgr", "e4e3a4f782569fa3bf0135297942c8a1c791ec869ca036bf530ab95633d17815"); + bm.deleteTxByHash(app,"wgr", "cc89779e8e57d49e5e6d3e16ad57e648b19d86fb8f4714bc7df5abd3f92daa1d"); + bm.deleteTxByHash(app,"wgr", "d8e1e8389bbcffe1c79cf11e2206281377e54b99219ec6ccec296c2adb8ad65f"); + bm.deleteTxByHash(app,"wgr", "929972a7b2fdf55f6da7488ccaf7312fd5d22c4bca003ca089293c93f1c32917"); + bm.deleteTxByHash(app,"wgr", "e4e3a4f782569fa3bf0135297942c8a1c791ec869ca036bf530ab95633d17815"); + + // duplicate mappings + bm.deleteDuplicateMappings(app); } @Override