diff --git a/README.md b/README.md index 0275b33f..7df21745 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# BitcoinZ Wallet 2.0.7-u3 +# BitcoinZ Wallet 2.0.8 [Download here](https://github.com/btcz/bitcoinz-wallet/releases) @@ -83,7 +83,7 @@ The details of how to build it are described below (easy to follow). 3.1. If you have built BitcoinZ from source code: - Assuming you have already built from source code [BitcoinZ](https://github.com/btcz/bitcoinz) in directory `/home/user/bitcoinz/src` (for example - this is the typical build dir. for bitcoinz v2.0.7) which contains the command line tools `bitcoinz-cli` and `bitcoinzd` you need to take the created file `./build/jars/BitcoinZWallet.jar` and copy it to directory `/home/user/bitcoinz/src` (the same dir. that contains `bitcoinz-cli` and `bitcoinzd`). Example copy command: + Assuming you have already built from source code [BitcoinZ](https://github.com/btcz/bitcoinz) in directory `/home/user/bitcoinz/src` (for example - this is the typical build dir. for bitcoinz v2.0.8) which contains the command line tools `bitcoinz-cli` and `bitcoinzd` you need to take the created file `./build/jars/BitcoinZWallet.jar` and copy it to directory `/home/user/bitcoinz/src` (the same dir. that contains `bitcoinz-cli` and `bitcoinzd`). Example copy command: ``` cp ./build/jars/BitcoinZWallet.jar /home/user/zen/src ``` diff --git a/src/build/build.xml b/src/build/build.xml index 4eb6f594..186cdf1b 100644 --- a/src/build/build.xml +++ b/src/build/build.xml @@ -100,7 +100,7 @@ - diff --git a/src/java/com/bitcoinz/btczui/AboutDialog.java b/src/java/com/bitcoinz/btczui/AboutDialog.java index 307d6142..2d826bb8 100644 --- a/src/java/com/bitcoinz/btczui/AboutDialog.java +++ b/src/java/com/bitcoinz/btczui/AboutDialog.java @@ -86,7 +86,7 @@ public AboutDialog(JFrame parent) throws UnsupportedEncodingException{ " |____/ | | | |/ / / / \\ \\| | | |\\ | | / / \\ \\ /\\ / / _` | | |/ _ \\ __| | | || | \n" + " | ___ \\| |_ | |\\ \\__ \\ \\_/ /| |_ | | \\ | / /_ \\ V V / (_| | | | __/ |_| |_| || | \n" + " |_____/____| |_| \\____|\\___/_____||_| \\_|/____| \\_/\\_/ \\__,_|_|_|\\___|\\__|\\___/|___| \n" + - " Version 2.0.7-u3 \n \n" + + " Version 2.0.8 \n \n" + " Copyright (c) 2017-2022 BitcoinZ team \n" + " Copyright (c) 2016-2018 Ivan Vaklinov <ivan@vaklinov.com> \n" + @@ -128,7 +128,7 @@ public AboutDialog(JFrame parent) throws UnsupportedEncodingException{ aboutNORTH_CENTER.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); aboutNORTH_CENTER.setText( "" + - "BitcoinZ Wallet UI
 Version 2.0.7-u3"); + "BitcoinZ Wallet UI
 Version 2.0.8"); // About description JLabel aboutCENTER = new JLabel(); @@ -181,6 +181,9 @@ public AboutDialog(JFrame parent) throws UnsupportedEncodingException{ "" + "
" + + "v2.0.8 (SEP-2022)
"+ + "- Added Viewing key import and usage.

"+ + "v2.0.7-u3 (MAY-2022)
"+ "- Added option to disable the (z) messaging.
"+ "- Added Raw TX tab with data send capability.
"+ diff --git a/src/java/com/bitcoinz/btczui/AddressTable.java b/src/java/com/bitcoinz/btczui/AddressTable.java index 0f87bffb..b3201ab7 100644 --- a/src/java/com/bitcoinz/btczui/AddressTable.java +++ b/src/java/com/bitcoinz/btczui/AddressTable.java @@ -67,7 +67,7 @@ public void actionPerformed(ActionEvent e){ if ((lastRow >= 0) && (lastColumn >= 0)){ try{ - String address = AddressTable.this.getModel().getValueAt(lastRow, 2).toString(); + String address = AddressTable.this.getModel().getValueAt(lastRow, 3).toString(); boolean isZAddress = Util.isZAddress(address); // Check for encrypted wallet @@ -121,7 +121,7 @@ public void actionPerformed(ActionEvent e){ if ((lastRow >= 0) && (lastColumn >= 0)){ try{ - String address = AddressTable.this.getModel().getValueAt(lastRow, 2).toString(); + String address = AddressTable.this.getModel().getValueAt(lastRow, 3).toString(); boolean isZAddress = Util.isZAddress(address); // Check for encrypted wallet @@ -176,7 +176,7 @@ public void actionPerformed(ActionEvent e){ if ((lastRow >= 0) && (lastColumn >= 0)){ try{ - String address = AddressTable.this.getModel().getValueAt(lastRow, 2).toString(); + String address = AddressTable.this.getModel().getValueAt(lastRow, 3).toString(); boolean isZAddress = Util.isZAddress(address); // Check for encrypted wallet @@ -253,7 +253,7 @@ public void actionPerformed(ActionEvent e) { try { - String address = AddressTable.this.getModel().getValueAt(lastRow, 2).toString(); + String address = AddressTable.this.getModel().getValueAt(lastRow, 3).toString(); boolean isZAddress = Util.isZAddress(address); // Check for encrypted wallet diff --git a/src/java/com/bitcoinz/btczui/AddressesPanel.java b/src/java/com/bitcoinz/btczui/AddressesPanel.java index 32151aba..5c59b31b 100644 --- a/src/java/com/bitcoinz/btczui/AddressesPanel.java +++ b/src/java/com/bitcoinz/btczui/AddressesPanel.java @@ -38,6 +38,7 @@ import java.text.DecimalFormat; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; import java.util.Set; @@ -334,12 +335,13 @@ private synchronized void updateWalletAddressBalanceTableAutomated() private JTable createAddressBalanceTable(String rowData[][]) throws WalletCallException, IOException, InterruptedException { - String columnNames[] = { "Balance", "Confirmed?", "Address" }; + String columnNames[] = { "Balance", "Confirmed?", "", "Address" }; JTable table = new AddressTable(rowData, columnNames, this.clientCaller); table.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS); table.getColumnModel().getColumn(0).setPreferredWidth(160); table.getColumnModel().getColumn(1).setPreferredWidth(140); - table.getColumnModel().getColumn(2).setPreferredWidth(1000); + table.getColumnModel().getColumn(2).setPreferredWidth(80); + table.getColumnModel().getColumn(3).setPreferredWidth(1000); return table; } @@ -348,8 +350,11 @@ private JTable createAddressBalanceTable(String rowData[][]) private String[][] getAddressBalanceDataFromWallet() throws WalletCallException, IOException, InterruptedException { - // Z Addresses - they are OK - String[] zAddresses = clientCaller.getWalletZAddresses(); + // Z Addresses + // Modified to get also the Viewing Key + List zAdrrData = clientCaller.getWalletZAddresses(); + List zAddresses = zAdrrData.get(0); + List isVKsOnly = zAdrrData.get(1); // T Addresses listed with the list received by addr comamnd String[] tAddresses = this.clientCaller.getWalletAllPublicAddresses(); @@ -372,7 +377,7 @@ private String[][] getAddressBalanceDataFromWallet() tAddressesCombined.addAll(tStoredAddressSet); tAddressesCombined.addAll(tAddressSetWithUnspentOuts); - String[][] addressBalances = new String[zAddresses.length + tAddressesCombined.size()][]; + String[][] addressBalances = new String[zAddresses.size() + tAddressesCombined.size()][]; // Format double numbers - else sometimes we get exponential notation 1E-4 BTCZ DecimalFormat df = new DecimalFormat("########0.00######"); @@ -432,12 +437,19 @@ private String[][] getAddressBalanceDataFromWallet() { balanceToShow, isConfirmed ? ("Yes " + confirmed) : ("No " + notConfirmed), + "", addressToDisplay }; } - for (String address : zAddresses) + + + + for (int ii = 0; ii < zAddresses.size(); ii++) { + boolean isVKonly = isVKsOnly.get(ii); + String address = zAddresses.get(ii); + String confirmedBalance = this.clientCaller.getBalanceForAddress(address); String unconfirmedBalance = this.clientCaller.getUnconfirmedBalanceForAddress(address); boolean isConfirmed = (confirmedBalance.equals(unconfirmedBalance)); @@ -448,8 +460,10 @@ private String[][] getAddressBalanceDataFromWallet() { balanceToShow, isConfirmed ? ("Yes " + confirmed) : ("No " + notConfirmed), + isVKonly ? ("vk") : (""), address }; + } return addressBalances; diff --git a/src/java/com/bitcoinz/btczui/BTCZClientCaller.java b/src/java/com/bitcoinz/btczui/BTCZClientCaller.java index 260d16e7..28c91e0d 100644 --- a/src/java/com/bitcoinz/btczui/BTCZClientCaller.java +++ b/src/java/com/bitcoinz/btczui/BTCZClientCaller.java @@ -240,7 +240,7 @@ public synchronized String[][] getWalletPublicTransactions() String strTransactions[][] = new String[jsonTransactions.size()][]; for (int i = 0; i < jsonTransactions.size(); i++) { - strTransactions[i] = new String[7]; + strTransactions[i] = new String[8]; JsonObject trans = jsonTransactions.get(i).asObject(); // Needs to be the same as in getWalletZReceivedTransactions() @@ -248,45 +248,78 @@ public synchronized String[][] getWalletPublicTransactions() strTransactions[i][0] = "\u2606T (Public)"; strTransactions[i][1] = trans.getString("category", "ERROR!"); strTransactions[i][2] = trans.get("confirmations").toString(); - strTransactions[i][3] = trans.get("amount").toString(); - strTransactions[i][4] = trans.get("time").toString(); - strTransactions[i][5] = trans.getString("address", notListed + " (Z Address not listed by wallet!)"); - strTransactions[i][6] = trans.get("txid").toString(); + strTransactions[i][3] = " "; + strTransactions[i][4] = trans.get("amount").toString(); + strTransactions[i][5] = trans.get("time").toString(); + strTransactions[i][6] = trans.getString("address", notListed + " (Z Address not listed by wallet!)"); + strTransactions[i][7] = trans.get("txid").toString(); } return strTransactions; } - - public synchronized String[] getWalletZAddresses() + // Changed to list return to add viewing key + public synchronized List getWalletZAddresses() throws WalletCallException, IOException, InterruptedException { + + // Modified for the Viewing key for YODA 2.0.8 + // TODO : return the VK advice from the cli ? JsonArray jsonAddresses = executeCommandAndGetJsonArray("z_listaddresses", null); - String strAddresses[] = new String[jsonAddresses.size()]; + JsonArray jsonAddressesVK = executeCommandAndGetJsonArray("z_listaddresses", "true"); + List strAddresses = new ArrayList(); // [jsonAddresses.size()+jsonAddressesVK.size()]; + List isVKonly = new ArrayList(); //[jsonAddresses.size()+jsonAddressesVK.size()]; + for (int i = 0; i < jsonAddresses.size(); i++) { - strAddresses[i] = jsonAddresses.get(i).asString(); + strAddresses.add(jsonAddresses.get(i).asString()); + isVKonly.add(false); } - return strAddresses; + // The order of the keys can not be defined (viwing or spending) + // Also a secound loop needs to be done to diferiencate it... :-| + // TODO: Find a better way or maybe return it from cli directly. + for (int i = 0; i < jsonAddressesVK.size(); i++) + { + if(strAddresses.contains(jsonAddressesVK.get(i).asString()) == false) + { + strAddresses.add(jsonAddressesVK.get(i).asString()); + isVKonly.add(true); + } + + } + + List retVal = new ArrayList(); + retVal.add(strAddresses); + retVal.add(isVKonly); + return retVal; } public synchronized String[][] getWalletZReceivedTransactions() throws WalletCallException, IOException, InterruptedException { - String[] zAddresses = this.getWalletZAddresses(); + + // Modified to get also the Viewing Key + List zAdrrData = this.getWalletZAddresses(); + List zAddresses = zAdrrData.get(0); + List isVKsOnly = zAdrrData.get(1); List zReceivedTransactions = new ArrayList(); + int k = 0; for (String zAddress : zAddresses) { + + boolean isVKonly = isVKsOnly.get(k); + k++; + JsonArray jsonTransactions = executeCommandAndGetJsonArray( "z_listreceivedbyaddress", wrapStringParameter(zAddress), "0"); for (int i = 0; i < jsonTransactions.size(); i++) { - String[] currentTransaction = new String[7]; + String[] currentTransaction = new String[8]; JsonObject trans = jsonTransactions.get(i).asObject(); String txID = trans.getString("txid", "ERROR!"); @@ -295,10 +328,11 @@ public synchronized String[][] getWalletZReceivedTransactions() currentTransaction[0] = "\u2605Z (Private)"; currentTransaction[1] = "receive"; currentTransaction[2] = this.getWalletTransactionConfirmations(txID); - currentTransaction[3] = trans.get("amount").toString(); - currentTransaction[4] = this.getWalletTransactionTime(txID); // TODO: minimize sub-calls - currentTransaction[5] = zAddress; - currentTransaction[6] = trans.get("txid").toString(); + currentTransaction[3] = isVKonly ? ("vk") : (""); + currentTransaction[4] = trans.get("amount").toString(); + currentTransaction[5] = this.getWalletTransactionTime(txID); // TODO: minimize sub-calls + currentTransaction[6] = zAddress; + currentTransaction[7] = trans.get("txid").toString(); zReceivedTransactions.add(currentTransaction); } @@ -1139,6 +1173,20 @@ else if (isTestnet == true ? first_letter.equals("9") || first_letter.equals("c" } else throw new WalletCallException("Unexpected response from wallet: " + strResult); // Obviously an error } + // The Viewing Key bigin with z : zxviews1qvnx7... + else if (first_letter.equals("Z") || first_letter.equals("z")) + { + String strResult = this.executeCommandAndGetSingleStringResponse( + "-rpcclienttimeout=5000", "z_importviewingkey", wrapStringParameter(key)); + + // TODO: Give the possibility to rescan. By default the VK do not rescan. + + if (!strResult.trim().toLowerCase(Locale.ROOT).contains("error")) + { + return strResult == null ? "" : strResult.trim(); + } + else throw new WalletCallException("Unexpected response from wallet: " + strResult); // Obviously an error + } else { throw new WalletCallException(isTestnet == true ? "TestNet private key should start with a '9' or 'c'" : "Single private key should start with L, K, or 5"); diff --git a/src/java/com/bitcoinz/btczui/BtczUI.java b/src/java/com/bitcoinz/btczui/BtczUI.java index e2fcece7..da449b5d 100644 --- a/src/java/com/bitcoinz/btczui/BtczUI.java +++ b/src/java/com/bitcoinz/btczui/BtczUI.java @@ -116,7 +116,7 @@ public class BtczUI public BtczUI(StartupProgressDialog progressDialog) throws IOException, InterruptedException, WalletCallException { - super("BitcoinZ Wallet 2.0.7-u3"); + super("BitcoinZ Wallet 2.0.8"); if (progressDialog != null) { diff --git a/src/java/com/bitcoinz/btczui/DashboardPanel.java b/src/java/com/bitcoinz/btczui/DashboardPanel.java index 018d3849..f30b509f 100644 --- a/src/java/com/bitcoinz/btczui/DashboardPanel.java +++ b/src/java/com/bitcoinz/btczui/DashboardPanel.java @@ -587,16 +587,17 @@ private void updateWalletTransactionsTable() private JTable createTransactionsTable(String rowData[][]) throws WalletCallException, IOException, InterruptedException { - String columnNames[] = { "Type", "Direction", "Confirmed?", "Amount", "Date", "Destination Address"}; + String columnNames[] = { "Type", "Direction", "Confirmed?", " ", "Amount", "Date", "Destination Address"}; JTable table = new TransactionTable( rowData, columnNames, this.parentFrame, this.clientCaller, this.installationObserver); table.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS); table.getColumnModel().getColumn(0).setPreferredWidth(190); table.getColumnModel().getColumn(1).setPreferredWidth(145); table.getColumnModel().getColumn(2).setPreferredWidth(170); - table.getColumnModel().getColumn(3).setPreferredWidth(210); - table.getColumnModel().getColumn(4).setPreferredWidth(405); - table.getColumnModel().getColumn(5).setPreferredWidth(800); + table.getColumnModel().getColumn(3).setPreferredWidth(80); + table.getColumnModel().getColumn(4).setPreferredWidth(210); + table.getColumnModel().getColumn(5).setPreferredWidth(405); + table.getColumnModel().getColumn(6).setPreferredWidth(800); return table; } @@ -628,15 +629,15 @@ private String[][] getTransactionsDataFromWallet() public int compare(String[] o1, String[] o2) { Date d1 = new Date(0); - if (!o1[4].equals("N/A")) + if (!o1[5].equals("N/A")) { - d1 = new Date(Long.valueOf(o1[4]).longValue() * 1000L); + d1 = new Date(Long.valueOf(o1[5]).longValue() * 1000L); } Date d2 = new Date(0); - if (!o2[4].equals("N/A")) + if (!o2[5].equals("N/A")) { - d2 = new Date(Long.valueOf(o2[4]).longValue() * 1000L); + d2 = new Date(Long.valueOf(o2[5]).longValue() * 1000L); } if (d1.equals(d2)) @@ -684,23 +685,23 @@ public int compare(String[] o1, String[] o2) }; // Date - if (!trans[4].equals("N/A")) + if (!trans[5].equals("N/A")) { - trans[4] = new Date(Long.valueOf(trans[4]).longValue() * 1000L).toLocaleString(); + trans[5] = new Date(Long.valueOf(trans[5]).longValue() * 1000L).toLocaleString(); } // Amount try { - double amount = Double.valueOf(trans[3]); + double amount = Double.valueOf(trans[4]); if (amount < 0d) { amount = -amount; } - trans[3] = df.format(amount); + trans[4] = df.format(amount); } catch (NumberFormatException nfe) { - Log.error("Error occurred while formatting amount: " + trans[3] + + Log.error("Error occurred while formatting amount: " + trans[4] + " - " + nfe.getMessage() + "!"); } diff --git a/src/java/com/bitcoinz/btczui/RawTXPanel.java b/src/java/com/bitcoinz/btczui/RawTXPanel.java index 9fb311de..94847aa9 100644 --- a/src/java/com/bitcoinz/btczui/RawTXPanel.java +++ b/src/java/com/bitcoinz/btczui/RawTXPanel.java @@ -52,6 +52,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashSet; +import java.util.List; import java.util.Set; import javax.swing.BorderFactory; @@ -666,7 +667,7 @@ private String[][] getAddressPositiveBalanceDataFromWallet() throws WalletCallException, IOException, InterruptedException { // Z Addresses - they are OK - String[] zAddresses = clientCaller.getWalletZAddresses(); + List zAddresses = clientCaller.getWalletZAddresses().get(0); // T Addresses created inside wallet that may be empty String[] tAddresses = this.clientCaller.getWalletAllPublicAddresses(); @@ -689,7 +690,7 @@ private String[][] getAddressPositiveBalanceDataFromWallet() tAddressesCombined.addAll(tStoredAddressSet); tAddressesCombined.addAll(tAddressSetWithUnspentOuts); - String[][] tempAddressBalances = new String[zAddresses.length + tAddressesCombined.size()][]; + String[][] tempAddressBalances = new String[zAddresses.size() + tAddressesCombined.size()][]; int count = 0; diff --git a/src/java/com/bitcoinz/btczui/SendCashPanel.java b/src/java/com/bitcoinz/btczui/SendCashPanel.java index 14c9e431..a195c913 100644 --- a/src/java/com/bitcoinz/btczui/SendCashPanel.java +++ b/src/java/com/bitcoinz/btczui/SendCashPanel.java @@ -51,6 +51,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashSet; +import java.util.List; import java.util.Set; import javax.swing.BorderFactory; @@ -620,6 +621,8 @@ private void updateWalletAddressPositiveBalanceComboBox() lastAddressBalanceData = newAddressBalanceData; + // TODO: Find a way to remove the VK + comboBoxItems = new String[lastAddressBalanceData.length]; for (int i = 0; i < lastAddressBalanceData.length; i++) { @@ -650,8 +653,11 @@ private void updateWalletAddressPositiveBalanceComboBox() private String[][] getAddressPositiveBalanceDataFromWallet() throws WalletCallException, IOException, InterruptedException { - // Z Addresses - they are OK - String[] zAddresses = clientCaller.getWalletZAddresses(); + // Z Addresses + // Modified to get also the Viewing Key + List zAdrrData = clientCaller.getWalletZAddresses(); + List zAddresses = zAdrrData.get(0); + List isVKsOnly = zAdrrData.get(1); // T Addresses created inside wallet that may be empty String[] tAddresses = this.clientCaller.getWalletAllPublicAddresses(); @@ -674,7 +680,7 @@ private String[][] getAddressPositiveBalanceDataFromWallet() tAddressesCombined.addAll(tStoredAddressSet); tAddressesCombined.addAll(tAddressSetWithUnspentOuts); - String[][] tempAddressBalances = new String[zAddresses.length + tAddressesCombined.size()][]; + String[][] tempAddressBalances = new String[zAddresses.size() + tAddressesCombined.size()][]; int count = 0; @@ -685,19 +691,24 @@ private String[][] getAddressPositiveBalanceDataFromWallet() { tempAddressBalances[count++] = new String[] { - balance, address + balance, address, "" }; } } + int k = 0; for (String address : zAddresses) { String balance = this.clientCaller.getBalanceForAddress(address); + + boolean isVKonly = isVKsOnly.get(k); + k++; + if (Double.valueOf(balance) > 0) { tempAddressBalances[count++] = new String[] { - balance, address + balance, address, isVKonly ? ("vk") : ("") }; } } diff --git a/src/java/com/bitcoinz/btczui/StartupProgressDialog.java b/src/java/com/bitcoinz/btczui/StartupProgressDialog.java index bae9fbe9..d866f7b9 100644 --- a/src/java/com/bitcoinz/btczui/StartupProgressDialog.java +++ b/src/java/com/bitcoinz/btczui/StartupProgressDialog.java @@ -74,7 +74,7 @@ public StartupProgressDialog(BTCZClientCaller clientCaller){ contentPane.add(imageLabel, BorderLayout.NORTH); JLabel bitcoinzWalletLabel = new JLabel( "" + - "BitcoinZ Wallet UI
 Version 2.0.7-u3"); + "BitcoinZ Wallet UI
 Version 2.0.8"); bitcoinzWalletLabel.setBorder(BorderFactory.createEmptyBorder(16, 16, 16, 16)); // todo - place in a panel with flow center diff --git a/src/java/com/bitcoinz/btczui/TransactionTable.java b/src/java/com/bitcoinz/btczui/TransactionTable.java index ca9e007a..a49b5271 100644 --- a/src/java/com/bitcoinz/btczui/TransactionTable.java +++ b/src/java/com/bitcoinz/btczui/TransactionTable.java @@ -87,7 +87,7 @@ public void actionPerformed(ActionEvent e) { try { - String txID = TransactionTable.this.getModel().getValueAt(lastRow, 6).toString(); + String txID = TransactionTable.this.getModel().getValueAt(lastRow, 7).toString(); txID = txID.replaceAll("\"", ""); // In case it has quotes Log.info("Transaction ID for detail dialog is: " + txID); @@ -160,10 +160,10 @@ public void actionPerformed(ActionEvent e) Cursor oldCursor = parent.getCursor(); try { - String txID = TransactionTable.this.getModel().getValueAt(lastRow, 6).toString(); + String txID = TransactionTable.this.getModel().getValueAt(lastRow, 7).toString(); txID = txID.replaceAll("\"", ""); // In case it has quotes - String acc = TransactionTable.this.getModel().getValueAt(lastRow, 5).toString(); + String acc = TransactionTable.this.getModel().getValueAt(lastRow, 6).toString(); acc = acc.replaceAll("\"", ""); // In case it has quotes boolean isZAddress = Util.isZAddress(acc); diff --git a/src/java/com/bitcoinz/btczui/msg/CreateGroupDialog.java b/src/java/com/bitcoinz/btczui/msg/CreateGroupDialog.java index eeb18f60..89c0ddcc 100644 --- a/src/java/com/bitcoinz/btczui/msg/CreateGroupDialog.java +++ b/src/java/com/bitcoinz/btczui/msg/CreateGroupDialog.java @@ -35,6 +35,7 @@ import java.awt.event.ActionListener; import java.io.IOException; import java.util.HashSet; +import java.util.List; import java.util.Set; import javax.swing.BorderFactory; @@ -259,20 +260,20 @@ private void createGroupForKeyPhrase(String keyPhrase) throws IOException, InterruptedException, WalletCallException { String key = Util.convertGroupPhraseToZPrivateKey(keyPhrase); + List zAddresses = caller.getWalletZAddresses().get(0); // There is no way (it seems) to find out what Z address was added - we need to // analyze which one it is. // TODO: This relies that noone is importing keys at the same time! Set addressesBeforeAddition = new HashSet(); - for (String address: this.caller.getWalletZAddresses()) + for (String address: zAddresses) { addressesBeforeAddition.add(address); } CreateGroupDialog.this.caller.importPrivateKey(key); - Set addressesAfterAddition = new HashSet(); - for (String address: this.caller.getWalletZAddresses()) + for (String address : zAddresses) { addressesAfterAddition.add(address); } @@ -386,8 +387,9 @@ private String findZAddressForImportKey(String key) throws InterruptedException, WalletCallException, IOException { String address = null; + List zAddresses = caller.getWalletZAddresses().get(0); - for (String zAddr : this.caller.getWalletZAddresses()) + for (String zAddr : zAddresses) { String privKey = this.caller.getZPrivateKey(zAddr); if (privKey.equals(key)) diff --git a/src/java/com/bitcoinz/btczui/msg/MessagingPanel.java b/src/java/com/bitcoinz/btczui/msg/MessagingPanel.java index 3b496d80..5345f608 100644 --- a/src/java/com/bitcoinz/btczui/msg/MessagingPanel.java +++ b/src/java/com/bitcoinz/btczui/msg/MessagingPanel.java @@ -1527,7 +1527,7 @@ private void collectAndStoreNewReceivedMessages(MessagingIdentity groupIdentity) if ((ownIdentity != null) && (!this.identityZAddressValidityChecked)) { String ownZAddress = ownIdentity.getSendreceiveaddress(); - String[] walletZaddresses = this.clientCaller.getWalletZAddresses(); + List walletZaddresses = this.clientCaller.getWalletZAddresses().get(0); boolean bFound = false; for (String address : walletZaddresses) diff --git a/src/resources/ubuntu-package/BitcoinZWallet.desktop b/src/resources/ubuntu-package/BitcoinZWallet.desktop index 4b91d7d4..5d411d90 100644 --- a/src/resources/ubuntu-package/BitcoinZWallet.desktop +++ b/src/resources/ubuntu-package/BitcoinZWallet.desktop @@ -1,5 +1,5 @@ [Desktop Entry] -Version=2.0.7-u3 +Version=2.0.8 Name=BitcoinZ Wallet Comment=BitcoinZ Desktop GUI Wallet (full node) GenericName=BitcoinZ Wallet diff --git a/src/resources/ubuntu-package/control b/src/resources/ubuntu-package/control index d2e31b69..0d9c4abb 100644 --- a/src/resources/ubuntu-package/control +++ b/src/resources/ubuntu-package/control @@ -1,5 +1,5 @@ Package: bitcoinz-wallet -Version: 2.0.7-u3 +Version: 2.0.8 Section: misc Priority: low Architecture: all