Correct a comment, a few logging statements.

This commit is contained in:
Mike Hearn 2012-07-05 16:01:31 +02:00
parent 4bf8252041
commit ac3fc068d0

View file

@ -633,13 +633,11 @@ public class Wallet implements Serializable {
// or if a dead coinbase transaction has moved back onto the main chain. // or if a dead coinbase transaction has moved back onto the main chain.
boolean isDeadCoinbase = tx.isCoinBase() && dead.containsKey(tx.getHash()); boolean isDeadCoinbase = tx.isCoinBase() && dead.containsKey(tx.getHash());
if (isDeadCoinbase) { if (isDeadCoinbase) {
// There is a dead coinbase tx being received on the best chain. // There is a dead coinbase tx being received on the best chain. A coinbase tx is made dead when it moves
// A coinbase tx is made dead when it moves to a side chain but it can be switched back on a reorg and // to a side chain but it can be switched back on a reorg and 'resurrected' back to spent or unspent.
// 'resurrected' back to spent or unspent. // So take it out of the dead pool.
// Take it out of the dead pool. log.info(" coinbase tx {} <-dead: confidence {}", tx.getHashAsString(),
// The receive method will then treat it as a new transaction and put it in spent or unspent as appropriate. tx.getConfidence().getConfidenceType().name());
// TODO - Theorectically it could also be in the dead pool if it was double spent - this needs testing.
log.info(" coinbase tx {} <-dead", tx.getHashAsString() + ", confidence = " + tx.getConfidence().getConfidenceType().name());
dead.remove(tx.getHash()); dead.remove(tx.getHash());
} }
@ -647,12 +645,12 @@ public class Wallet implements Serializable {
if (!tx.getValueSentToMe(this).equals(BigInteger.ZERO)) { if (!tx.getValueSentToMe(this).equals(BigInteger.ZERO)) {
// It's sending us coins. // It's sending us coins.
log.info(" new tx {} ->unspent"); log.info(" new tx {} ->unspent", tx.getHashAsString());
boolean alreadyPresent = unspent.put(tx.getHash(), tx) != null; boolean alreadyPresent = unspent.put(tx.getHash(), tx) != null;
checkState(!alreadyPresent, "TX was received twice"); checkState(!alreadyPresent, "TX was received twice");
} else if (!tx.getValueSentFromMe(this).equals(BigInteger.ZERO)) { } else if (!tx.getValueSentFromMe(this).equals(BigInteger.ZERO)) {
// It spent some of our coins and did not send us any. // It spent some of our coins and did not send us any.
log.info(" new tx {} ->spent"); log.info(" new tx {} ->spent", tx.getHashAsString());
boolean alreadyPresent = spent.put(tx.getHash(), tx) != null; boolean alreadyPresent = spent.put(tx.getHash(), tx) != null;
checkState(!alreadyPresent, "TX was received twice"); checkState(!alreadyPresent, "TX was received twice");
} else { } else {