From 0ebdd5bbeaadf2c95aa891f175a3ede03081c0d5 Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Wed, 23 Mar 2016 14:04:58 +0100 Subject: [PATCH] TransactionInput: Print sequence number in toString(). --- core/src/main/java/org/bitcoinj/core/Transaction.java | 9 +++++---- .../main/java/org/bitcoinj/core/TransactionInput.java | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/org/bitcoinj/core/Transaction.java b/core/src/main/java/org/bitcoinj/core/Transaction.java index c91c4cc6e..57570e5d6 100644 --- a/core/src/main/java/org/bitcoinj/core/Transaction.java +++ b/core/src/main/java/org/bitcoinj/core/Transaction.java @@ -664,10 +664,11 @@ public class Transaction extends ChildMessage { s.append(Utils.HEX.encode(scriptPubKey.getPubKeyHash())); } } - String flags = Joiner.on(", ").skipNulls().join(in.hasSequence() ? "has sequence" : null, - in.isOptInFullRBF() ? "opts into full RBF" : null); - if (!flags.isEmpty()) - s.append("\n (").append(flags).append(')'); + 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("]"); } diff --git a/core/src/main/java/org/bitcoinj/core/TransactionInput.java b/core/src/main/java/org/bitcoinj/core/TransactionInput.java index b03cfab9d..4b38e3c82 100644 --- a/core/src/main/java/org/bitcoinj/core/TransactionInput.java +++ b/core/src/main/java/org/bitcoinj/core/TransactionInput.java @@ -479,7 +479,8 @@ public class TransactionInput extends ChildMessage { s.append(": COINBASE"); } else { 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); if (!flags.isEmpty()) s.append(" (").append(flags).append(')');