From 30455cb5ce1e6d7f9b5bbb0fbf0767f780b6279a Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Sat, 14 Dec 2013 13:21:33 -0800 Subject: [PATCH] Suppress some more info logging and update some javadocs. --- .../bitcoin/core/AbstractBlockChain.java | 6 +++--- .../com/google/bitcoin/core/PeerGroup.java | 21 ++++++++++++------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/core/src/main/java/com/google/bitcoin/core/AbstractBlockChain.java b/core/src/main/java/com/google/bitcoin/core/AbstractBlockChain.java index e8798507..9a7b24f1 100644 --- a/core/src/main/java/com/google/bitcoin/core/AbstractBlockChain.java +++ b/core/src/main/java/com/google/bitcoin/core/AbstractBlockChain.java @@ -428,9 +428,9 @@ public abstract class AbstractBlockChain { StoredBlock head = getChainHead(); if (storedPrev.equals(head)) { if (filtered && filteredTxn.size() > 0) { - log.info(format("Block %s connects to top of best chain with %d transaction(s) of which we were sent %d", - block.getHashAsString(), filteredTxHashList.size(), filteredTxn.size())); - for (Sha256Hash hash : filteredTxHashList) log.info(" matched tx {}", hash); + log.debug("Block {} connects to top of best chain with {} transaction(s) of which we were sent {}", + block.getHashAsString(), filteredTxHashList.size(), filteredTxn.size()); + for (Sha256Hash hash : filteredTxHashList) log.debug(" matched tx {}", hash); } if (expensiveChecks && block.getTimeSeconds() <= getMedianTimestampOfRecentBlocks(head, blockStore)) throw new VerificationException("Block's timestamp is too early"); diff --git a/core/src/main/java/com/google/bitcoin/core/PeerGroup.java b/core/src/main/java/com/google/bitcoin/core/PeerGroup.java index e2b1b208..2c57be3f 100644 --- a/core/src/main/java/com/google/bitcoin/core/PeerGroup.java +++ b/core/src/main/java/com/google/bitcoin/core/PeerGroup.java @@ -162,9 +162,13 @@ public class PeerGroup extends AbstractIdleService implements TransactionBroadca // A bloom filter generated from all connected wallets that is given to new peers private BloomFilter bloomFilter; - /** A reasonable default for the bloom filter false positive rate on mainnet. - * Users for which low data usage is of utmost concern, 0.0001 may be better, for users - * to whom anonymity is of utmost concern, 0.001 should provide very good privacy */ + /** + *

A reasonable default for the bloom filter false positive rate on mainnet. FP rates are values between 0.0 and 1.0 + * where 1.0 is "all transactions" i.e. 100%.

+ * + *

Users for which low data usage is of utmost concern, 0.0001 may be better, for users + * to whom anonymity is of utmost concern, 0.001 (0.1%) should provide very good privacy.

+ */ public static final double DEFAULT_BLOOM_FILTER_FP_RATE = 0.0005; /** Maximum increase in FP rate before forced refresh of the bloom filter */ public static final double MAX_FP_RATE_INCREASE = 2.0f; @@ -666,12 +670,13 @@ public class PeerGroup extends AbstractIdleService implements TransactionBroadca } /** - * Sets the false positive rate of bloom filters given to peers. - * Be careful regenerating the bloom filter too often, as it decreases anonymity because remote nodes can - * compare transactions against both the new and old filters to significantly decrease the false positive rate. + *

Sets the false positive rate of bloom filters given to peers. The default is {@link #DEFAULT_BLOOM_FILTER_FP_RATE}.

+ * + *

Be careful regenerating the bloom filter too often, as it decreases anonymity because remote nodes can + * compare transactions against both the new and old filters to significantly decrease the false positive rate.

* - * See the docs for {@link BloomFilter#BloomFilter(int, double, long, BloomFilter.BloomUpdate)} for a brief - * explanation of anonymity when using bloom filters. + *

See the docs for {@link BloomFilter#BloomFilter(int, double, long, BloomFilter.BloomUpdate)} for a brief + * explanation of anonymity when using bloom filters.

*/ public void setBloomFilterFalsePositiveRate(double bloomFilterFPRate) { lock.lock();