TransactionInput: Print sequence number in toString().

This commit is contained in:
Andreas Schildbach
2016-03-23 14:04:58 +01:00
parent 5aa4b66c7e
commit 0ebdd5bbea
2 changed files with 7 additions and 5 deletions

View File

@@ -664,10 +664,11 @@ public class Transaction extends ChildMessage {
s.append(Utils.HEX.encode(scriptPubKey.getPubKeyHash())); s.append(Utils.HEX.encode(scriptPubKey.getPubKeyHash()));
} }
} }
String flags = Joiner.on(", ").skipNulls().join(in.hasSequence() ? "has sequence" : null, if (in.hasSequence()) {
in.isOptInFullRBF() ? "opts into full RBF" : null); s.append("\n sequence:").append(Long.toHexString(in.getSequenceNumber()));
if (!flags.isEmpty()) if (in.isOptInFullRBF())
s.append("\n (").append(flags).append(')'); s.append(", opts into full RBF");
}
} catch (Exception e) { } catch (Exception e) {
s.append("[exception: ").append(e.getMessage()).append("]"); s.append("[exception: ").append(e.getMessage()).append("]");
} }

View File

@@ -479,7 +479,8 @@ public class TransactionInput extends ChildMessage {
s.append(": COINBASE"); s.append(": COINBASE");
} else { } else {
s.append(" for [").append(outpoint).append("]: ").append(getScriptSig()); s.append(" for [").append(outpoint).append("]: ").append(getScriptSig());
String flags = Joiner.on(", ").skipNulls().join(hasSequence() ? "has sequence" : null, String flags = Joiner.on(", ").skipNulls().join(
hasSequence() ? "sequence: " + Long.toHexString(sequence) : null,
isOptInFullRBF() ? "opts into full RBF" : null); isOptInFullRBF() ? "opts into full RBF" : null);
if (!flags.isEmpty()) if (!flags.isEmpty())
s.append(" (").append(flags).append(')'); s.append(" (").append(flags).append(')');