mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 05:06:45 +00:00
Correcting address column in exported CSV, removing Derivation column.
This commit is contained in:
parent
e88d6265b4
commit
57b3fd99bc
1 changed files with 3 additions and 6 deletions
|
@ -105,20 +105,17 @@ public class AddressesController extends WalletFormController implements Initial
|
||||||
FileChooser fileChooser = new FileChooser();
|
FileChooser fileChooser = new FileChooser();
|
||||||
fileChooser.setTitle("Export Addresses File");
|
fileChooser.setTitle("Export Addresses File");
|
||||||
String extension = "txt";
|
String extension = "txt";
|
||||||
fileChooser.setInitialFileName(getWalletForm().getWallet().getName() + "-" +
|
fileChooser.setInitialFileName(getWalletForm().getWallet().getName() + "-addresses.txt");
|
||||||
"addresses" +
|
|
||||||
(extension == null || extension.isEmpty() ? "" : "." + extension));
|
|
||||||
|
|
||||||
File file = fileChooser.showSaveDialog(window);
|
File file = fileChooser.showSaveDialog(window);
|
||||||
if(file != null) {
|
if(file != null) {
|
||||||
try(FileOutputStream outputStream = new FileOutputStream(file)) {
|
try(FileOutputStream outputStream = new FileOutputStream(file)) {
|
||||||
CsvWriter writer = new CsvWriter(outputStream, ',', StandardCharsets.UTF_8);
|
CsvWriter writer = new CsvWriter(outputStream, ',', StandardCharsets.UTF_8);
|
||||||
writer.writeRecord(new String[] {"Index", "Payment Address", "Derivation"});
|
writer.writeRecord(new String[] {"Index", "Payment Address"});
|
||||||
for(Entry entry : getWalletForm().getNodeEntry(KeyPurpose.RECEIVE).getChildren()) {
|
for(Entry entry : getWalletForm().getNodeEntry(KeyPurpose.RECEIVE).getChildren()) {
|
||||||
NodeEntry childEntry = (NodeEntry)entry;
|
NodeEntry childEntry = (NodeEntry)entry;
|
||||||
writer.write(childEntry.getNode().getIndex() + "");
|
writer.write(childEntry.getNode().getIndex() + "");
|
||||||
writer.write(childEntry.getNode().toString());
|
writer.write(childEntry.getAddress().toString());
|
||||||
writer.write(childEntry.getNode().getDerivationPath());
|
|
||||||
writer.endRecord();
|
writer.endRecord();
|
||||||
}
|
}
|
||||||
writer.close();
|
writer.close();
|
||||||
|
|
Loading…
Reference in a new issue