Don't crash if trying to print a transaction with no inputs

This commit is contained in:
Mike Hearn
2012-04-06 16:01:44 +02:00
parent a170372562
commit 265c76db59

View File

@@ -491,6 +491,10 @@ public class Transaction extends ChildMessage implements Serializable {
s.append(" ");
s.append(getHashAsString());
s.append("\n");
if (inputs.size() == 0) {
s.append(" INCOMPLETE: No inputs!\n");
return s.toString();
}
if (isCoinBase()) {
String script;
String script2;