add txid to transactions csv download

This commit is contained in:
Craig Raw 2021-10-05 10:55:20 +02:00
parent d6ad7f4808
commit 35b57f9d69
2 changed files with 5 additions and 2 deletions

View file

@ -66,7 +66,9 @@ public class MixStatusCell extends TreeTableCell<Entry, UtxoEntry.MixStatus> {
if(mixFailReason != MixFailReason.CANCEL) { if(mixFailReason != MixFailReason.CANCEL) {
setGraphic(getFailGlyph()); setGraphic(getFailGlyph());
Tooltip tt = new Tooltip(); Tooltip tt = new Tooltip();
tt.setText(mixFailReason.getMessage() + (mixError == null ? "" : ": " + mixError) + "\nMake sure your internet connection is stable and the computer is configured to prevent sleeping."); tt.setText(mixFailReason.getMessage() + (mixError == null ? "" : ": " + mixError) +
"\nMix failures are generally caused by peers disconnecting during a mix." +
"\nMake sure your internet connection is stable and the computer is configured to prevent sleeping.");
setTooltip(tt); setTooltip(tt);
} else { } else {
setGraphic(null); setGraphic(null);

View file

@ -132,13 +132,14 @@ public class TransactionsController extends WalletFormController implements Init
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[] {"Date", "Label", "Value", "Balance"}); writer.writeRecord(new String[] {"Date", "Label", "Value", "Balance", "Txid"});
for(Entry entry : walletTransactionsEntry.getChildren()) { for(Entry entry : walletTransactionsEntry.getChildren()) {
TransactionEntry txEntry = (TransactionEntry)entry; TransactionEntry txEntry = (TransactionEntry)entry;
writer.write(txEntry.getBlockTransaction().getDate() == null ? "Unconfirmed" : EntryCell.DATE_FORMAT.format(txEntry.getBlockTransaction().getDate())); writer.write(txEntry.getBlockTransaction().getDate() == null ? "Unconfirmed" : EntryCell.DATE_FORMAT.format(txEntry.getBlockTransaction().getDate()));
writer.write(txEntry.getLabel()); writer.write(txEntry.getLabel());
writer.write(getCoinValue(txEntry.getValue())); writer.write(getCoinValue(txEntry.getValue()));
writer.write(getCoinValue(txEntry.getBalance())); writer.write(getCoinValue(txEntry.getBalance()));
writer.write(txEntry.getBlockTransaction().getHash().toString());
writer.endRecord(); writer.endRecord();
} }
writer.close(); writer.close();