3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-01-30 23:02:15 +00:00

Don't build/send Bloom filters when there are no keys in any wallets.

Resolves issue 324.
This commit is contained in:
Mike Hearn 2013-02-19 14:43:50 +01:00
parent 72d6f23e92
commit f4033076e8

View File

@ -570,7 +570,7 @@ public class PeerGroup extends AbstractIdleService {
elements += w.getBloomFilterElementCount();
}
if (chain == null || !chain.shouldVerifyTransactions()) {
if (chain == null || !chain.shouldVerifyTransactions() && elements > 0) {
// We stair-step our element count so that we avoid creating a filter with different parameters
// as much as possible as that results in a loss of privacy.
// The constant 100 here is somewhat arbitrary, but makes sense for small to medium wallets -
@ -587,7 +587,7 @@ public class PeerGroup extends AbstractIdleService {
peer.sendMessage(filter);
} catch (IOException e) { }
}
//Do this last so that bloomFilter is already set when it gets called
// Do this last so that bloomFilter is already set when it gets called.
setFastCatchupTimeSecs(earliestKeyTime);
}