From 626117bc29fb9a0c9a7d1efd1fe59bbe1224d0f7 Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Tue, 22 Jul 2014 16:04:26 +0200 Subject: [PATCH] Add logging for output disconnection and reconnection. --- .../java/com/google/bitcoin/core/TransactionOutput.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/src/main/java/com/google/bitcoin/core/TransactionOutput.java b/core/src/main/java/com/google/bitcoin/core/TransactionOutput.java index 70d4a406..3a6b37f7 100644 --- a/core/src/main/java/com/google/bitcoin/core/TransactionOutput.java +++ b/core/src/main/java/com/google/bitcoin/core/TransactionOutput.java @@ -233,12 +233,20 @@ public class TransactionOutput extends ChildMessage implements Serializable { checkState(availableForSpending); availableForSpending = false; spentBy = input; + if (parentTransaction != null) + log.info("Marked {}:{} as spent by {}", parentTransaction.getHash(), getIndex(), input); + else + log.info("Marked floating output as spent by {}", input); } /** * Resets the spent pointer / availableForSpending flag to null. */ public void markAsUnspent() { + if (parentTransaction != null) + log.info("Un-marked {}:{} as spent by {}", parentTransaction.getHash(), getIndex(), spentBy); + else + log.info("Un-marked floating output as spent by {}", spentBy); availableForSpending = true; spentBy = null; }