mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-11-13 19:07:12 +00:00
Transaction.toString(): Print incomplete transactions, too.
This commit is contained in:
@@ -658,10 +658,6 @@ public class Transaction extends ChildMessage {
|
|||||||
if (isOptInFullRBF()) {
|
if (isOptInFullRBF()) {
|
||||||
s.append(" opts into full replace-by-fee\n");
|
s.append(" opts into full replace-by-fee\n");
|
||||||
}
|
}
|
||||||
if (inputs.size() == 0) {
|
|
||||||
s.append(" INCOMPLETE: No inputs!\n");
|
|
||||||
return s.toString();
|
|
||||||
}
|
|
||||||
if (isCoinBase()) {
|
if (isCoinBase()) {
|
||||||
String script;
|
String script;
|
||||||
String script2;
|
String script2;
|
||||||
@@ -676,36 +672,41 @@ public class Transaction extends ChildMessage {
|
|||||||
.append(") (scriptPubKey ").append(script2).append(")\n");
|
.append(") (scriptPubKey ").append(script2).append(")\n");
|
||||||
return s.toString();
|
return s.toString();
|
||||||
}
|
}
|
||||||
for (TransactionInput in : inputs) {
|
if (!inputs.isEmpty()) {
|
||||||
s.append(" ");
|
for (TransactionInput in : inputs) {
|
||||||
s.append("in ");
|
s.append(" ");
|
||||||
|
s.append("in ");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Script scriptSig = in.getScriptSig();
|
Script scriptSig = in.getScriptSig();
|
||||||
s.append(scriptSig);
|
s.append(scriptSig);
|
||||||
if (in.getValue() != null)
|
if (in.getValue() != null)
|
||||||
s.append(" ").append(in.getValue().toFriendlyString());
|
s.append(" ").append(in.getValue().toFriendlyString());
|
||||||
s.append("\n ");
|
s.append("\n ");
|
||||||
s.append("outpoint:");
|
s.append("outpoint:");
|
||||||
final TransactionOutPoint outpoint = in.getOutpoint();
|
final TransactionOutPoint outpoint = in.getOutpoint();
|
||||||
s.append(outpoint.toString());
|
s.append(outpoint.toString());
|
||||||
final TransactionOutput connectedOutput = outpoint.getConnectedOutput();
|
final TransactionOutput connectedOutput = outpoint.getConnectedOutput();
|
||||||
if (connectedOutput != null) {
|
if (connectedOutput != null) {
|
||||||
Script scriptPubKey = connectedOutput.getScriptPubKey();
|
Script scriptPubKey = connectedOutput.getScriptPubKey();
|
||||||
if (scriptPubKey.isSentToAddress() || scriptPubKey.isPayToScriptHash()) {
|
if (scriptPubKey.isSentToAddress() || scriptPubKey.isPayToScriptHash()) {
|
||||||
s.append(" hash160:");
|
s.append(" hash160:");
|
||||||
s.append(Utils.HEX.encode(scriptPubKey.getPubKeyHash()));
|
s.append(Utils.HEX.encode(scriptPubKey.getPubKeyHash()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (in.hasSequence()) {
|
||||||
|
s.append("\n sequence:").append(Long.toHexString(in.getSequenceNumber()));
|
||||||
|
if (in.isOptInFullRBF())
|
||||||
|
s.append(", opts into full RBF");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
s.append("[exception: ").append(e.getMessage()).append("]");
|
||||||
}
|
}
|
||||||
if (in.hasSequence()) {
|
s.append('\n');
|
||||||
s.append("\n sequence:").append(Long.toHexString(in.getSequenceNumber()));
|
|
||||||
if (in.isOptInFullRBF())
|
|
||||||
s.append(", opts into full RBF");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
s.append("[exception: ").append(e.getMessage()).append("]");
|
|
||||||
}
|
}
|
||||||
s.append('\n');
|
} else {
|
||||||
|
s.append(" ");
|
||||||
|
s.append("INCOMPLETE: No inputs!\n");
|
||||||
}
|
}
|
||||||
for (TransactionOutput out : outputs) {
|
for (TransactionOutput out : outputs) {
|
||||||
s.append(" ");
|
s.append(" ");
|
||||||
|
|||||||
Reference in New Issue
Block a user