In Transaction.toString(): For outpoints, show the pubkey-hash of the connected output (if available). This makes it easier to debug wallets.

This commit is contained in:
Andreas Schildbach
2014-03-13 13:53:58 +01:00
parent 635002ce11
commit d5ffe88cff

View File

@@ -614,8 +614,15 @@ public class Transaction extends ChildMessage implements Serializable {
try {
Script scriptSig = in.getScriptSig();
s.append(scriptSig);
s.append(" / ");
s.append(in.getOutpoint().toString());
s.append("\n ");
s.append("outpoint:");
final TransactionOutPoint outpoint = in.getOutpoint();
s.append(outpoint.toString());
final TransactionOutput connectedOutput = outpoint.getConnectedOutput();
if (connectedOutput != null) {
s.append(" hash160:");
s.append(Utils.bytesToHexString(connectedOutput.getScriptPubKey().getPubKeyHash()));
}
} catch (Exception e) {
s.append("[exception: ").append(e.getMessage()).append("]");
}