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
committed by Mike Hearn
parent 6c5e1344ba
commit 1b0954a84a

View File

@@ -634,8 +634,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("]");
}