3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-01-31 15:22:16 +00:00

Harmonize how BTC values are printed to the log by Wallet.completeTx(). Also, print the value that is emptied.

This commit is contained in:
Andreas Schildbach 2014-06-15 11:58:26 +02:00 committed by Mike Hearn
parent f4d24bffb1
commit f86463bab3

View File

@ -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