From f86463bab3ad92f1315217f9c10dc9c86d95f674 Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Sun, 15 Jun 2014 11:58:26 +0200 Subject: [PATCH] Harmonize how BTC values are printed to the log by Wallet.completeTx(). Also, print the value that is emptied. --- core/src/main/java/com/google/bitcoin/core/Wallet.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/com/google/bitcoin/core/Wallet.java b/core/src/main/java/com/google/bitcoin/core/Wallet.java index 281fb656..c692c01c 100644 --- a/core/src/main/java/com/google/bitcoin/core/Wallet.java +++ b/core/src/main/java/com/google/bitcoin/core/Wallet.java @@ -2440,8 +2440,8 @@ public class Wallet extends BaseTaggableObject implements Serializable, BlockCha } Coin totalOutput = value; - log.info("Completing send tx with {} outputs totalling {} satoshis (not including fees)", - req.tx.getOutputs().size(), value); + log.info("Completing send tx with {} outputs totalling {} BTC (not including fees)", + req.tx.getOutputs().size(), value.toFriendlyString()); // If any inputs have already been added, we don't need to get their value from wallet Coin totalInput = Coin.ZERO; @@ -2490,6 +2490,7 @@ public class Wallet extends BaseTaggableObject implements Serializable, BlockCha candidates = null; // Selector took ownership and might have changed candidates. Don't access again. req.tx.getOutput(0).setValue(bestCoinSelection.valueGathered); totalOutput = bestCoinSelection.valueGathered; + log.info(" emptying {} BTC", bestCoinSelection.valueGathered.toFriendlyString()); } for (TransactionOutput output : bestCoinSelection.gathered) @@ -2508,7 +2509,7 @@ public class Wallet extends BaseTaggableObject implements Serializable, BlockCha if (bestChangeOutput != null) { req.tx.addOutput(bestChangeOutput); totalOutput = totalOutput.add(bestChangeOutput.getValue()); - log.info(" with {} coins change", bestChangeOutput.getValue().toFriendlyString()); + log.info(" with {} BTC change", bestChangeOutput.getValue().toFriendlyString()); } // Now shuffle the outputs to obfuscate which is the change. @@ -2526,7 +2527,7 @@ public class Wallet extends BaseTaggableObject implements Serializable, BlockCha final Coin calculatedFee = req.tx.getFee(); if (calculatedFee != null) { - log.info(" with a fee of {}", calculatedFee.toFriendlyString()); + log.info(" with a fee of {} BTC", calculatedFee.toFriendlyString()); } // Label the transaction as being self created. We can use this later to spend its change output even before