show MS addresses

This commit is contained in:
Manfred Karrer 2016-01-14 16:44:05 +01:00
parent 2a5dc9d2af
commit 54c2b397ae

View file

@ -39,7 +39,6 @@ public class TransactionsListItem {
private final Tooltip tooltip; private final Tooltip tooltip;
private String addressString; private String addressString;
private boolean notAnAddress;
private AddressConfidenceListener confidenceListener; private AddressConfidenceListener confidenceListener;
public TransactionsListItem(Transaction transaction, WalletService walletService, BSFormatter formatter) { public TransactionsListItem(Transaction transaction, WalletService walletService, BSFormatter formatter) {
@ -55,14 +54,10 @@ public class TransactionsListItem {
if (!transactionOutput.isMine(walletService.getWallet())) { if (!transactionOutput.isMine(walletService.getWallet())) {
type.set("Sent to"); type.set("Sent to");
if (transactionOutput.getScriptPubKey().isSentToAddress() || if (transactionOutput.getScriptPubKey().isSentToAddress()
transactionOutput.getScriptPubKey().isPayToScriptHash()) { || transactionOutput.getScriptPubKey().isPayToScriptHash()) {
address = address = transactionOutput.getScriptPubKey().getToAddress(walletService.getWallet().getParams());
transactionOutput.getScriptPubKey().getToAddress(walletService.getWallet().getParams());
addressString = address.toString(); addressString = address.toString();
} else {
addressString = "No sent to address script used.";
notAnAddress = true;
} }
} }
} }
@ -74,12 +69,8 @@ public class TransactionsListItem {
if (transactionOutput.isMine(walletService.getWallet())) { if (transactionOutput.isMine(walletService.getWallet())) {
if (transactionOutput.getScriptPubKey().isSentToAddress() || if (transactionOutput.getScriptPubKey().isSentToAddress() ||
transactionOutput.getScriptPubKey().isPayToScriptHash()) { transactionOutput.getScriptPubKey().isPayToScriptHash()) {
address = address = transactionOutput.getScriptPubKey().getToAddress(walletService.getWallet().getParams());
transactionOutput.getScriptPubKey().getToAddress(walletService.getWallet().getParams());
addressString = address.toString(); addressString = address.toString();
} else {
addressString = "No sent to address script used.";
notAnAddress = true;
} }
} }
} }
@ -91,12 +82,8 @@ public class TransactionsListItem {
outgoing = true; outgoing = true;
if (transactionOutput.getScriptPubKey().isSentToAddress() || transactionOutput.getScriptPubKey() if (transactionOutput.getScriptPubKey().isSentToAddress() || transactionOutput.getScriptPubKey()
.isPayToScriptHash()) { .isPayToScriptHash()) {
address = transactionOutput.getScriptPubKey().getToAddress(walletService.getWallet().getParams address = transactionOutput.getScriptPubKey().getToAddress(walletService.getWallet().getParams());
());
addressString = address.toString(); addressString = address.toString();
} else {
addressString = "No sent to address script used.";
notAnAddress = true;
} }
} }
} }
@ -105,8 +92,7 @@ public class TransactionsListItem {
type.set("Sent to"); type.set("Sent to");
} else { } else {
type.set("Internal (TX Fee)"); type.set("Internal (TX Fee)");
addressString = "Internal swap between addresses."; //addressString = "Internal swap between addresses.";
notAnAddress = true;
} }
} }
@ -190,7 +176,7 @@ public class TransactionsListItem {
} }
public boolean isNotAnAddress() { public boolean isNotAnAddress() {
return notAnAddress; return addressString == null;
} }
} }