3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-07 06:44:16 +00:00

Improved Transaction.toString

This commit is contained in:
Miron Cuperman 2012-02-09 10:28:15 -08:00
parent 9ba77a0d68
commit 7cc23e3e6b

View File

@ -502,6 +502,10 @@ public class Transaction extends ChildMessage implements Serializable {
try {
s.append(in.getScriptSig().getFromAddress().toString());
s.append(" / ");
s.append(in.getOutpoint().getHash());
s.append(":");
s.append(in.getOutpoint().getIndex());
} catch (Exception e) {
s.append("[exception: ").append(e.getMessage()).append("]");
}
@ -516,6 +520,13 @@ public class Transaction extends ChildMessage implements Serializable {
s.append(" ");
s.append(bitcoinValueToFriendlyString(out.getValue()));
s.append(" BTC");
if (!out.isAvailableForSpending()) {
s.append(" Spent");
}
if (out.getSpentBy() != null) {
s.append(" by ");
s.append(out.getSpentBy().getParentTransaction().getHashAsString());
}
} catch (Exception e) {
s.append("[exception: ").append(e.getMessage()).append("]");
}