/** * <p>Sets a Bloom filter on this connection. This will cause the given {@link BloomFilter} object to be sent to the * remote peer and if requested, a {@link MemoryPoolMessage} is sent as well to trigger downloading of any * pending transactions that may be relevant.</p> * * <p>The Peer does not automatically request filters from any wallets added using {@link Peer#addWallet(Wallet)}. * This is to allow callers to avoid redundantly recalculating the same filter repeatedly when using multiple peers * and multiple wallets together.</p> * * <p>Therefore, you should not use this method if your app uses a {@link PeerGroup}. It is called for you.</p> * * <p>If the remote peer doesn't support Bloom filtering, then this call is ignored. Once set you presently cannot * unset a filter, though the underlying p2p protocol does support it.</p> */ public void setBloomFilter(BloomFilter filter, boolean andQueryMemPool) { checkNotNull(filter, "Clearing filters is not currently supported"); final VersionMessage ver = vPeerVersionMessage; if (ver == null || !ver.isBloomFilteringSupported()) return; vBloomFilter = filter; log.debug("{}: Sending Bloom filter{}", this, andQueryMemPool ? " and querying mempool" : ""); sendMessage(filter); if (andQueryMemPool) sendMessage(new MemoryPoolMessage()); maybeRestartChainDownload(); }
/** * <p>Sets a Bloom filter on this connection. This will cause the given {@link BloomFilter} object to be sent to the * remote peer and if requested, a {@link MemoryPoolMessage} is sent as well to trigger downloading of any * pending transactions that may be relevant.</p> * * <p>The Peer does not automatically request filters from any wallets added using {@link Peer#addWallet(Wallet)}. * This is to allow callers to avoid redundantly recalculating the same filter repeatedly when using multiple peers * and multiple wallets together.</p> * * <p>Therefore, you should not use this method if your app uses a {@link PeerGroup}. It is called for you.</p> * * <p>If the remote peer doesn't support Bloom filtering, then this call is ignored. Once set you presently cannot * unset a filter, though the underlying p2p protocol does support it.</p> */ public void setBloomFilter(BloomFilter filter, boolean andQueryMemPool) { checkNotNull(filter, "Clearing filters is not currently supported"); final VersionMessage ver = vPeerVersionMessage; if (ver == null || !ver.isBloomFilteringSupported()) return; vBloomFilter = filter; log.debug("{}: Sending Bloom filter{}", this, andQueryMemPool ? " and querying mempool" : ""); sendMessage(filter); if (andQueryMemPool) sendMessage(new MemoryPoolMessage()); maybeRestartChainDownload(); }
/** * <p>Sets a Bloom filter on this connection. This will cause the given {@link BloomFilter} object to be sent to the * remote peer and if requested, a {@link MemoryPoolMessage} is sent as well to trigger downloading of any * pending transactions that may be relevant.</p> * * <p>The Peer does not automatically request filters from any wallets added using {@link Peer#addWallet(Wallet)}. * This is to allow callers to avoid redundantly recalculating the same filter repeatedly when using multiple peers * and multiple wallets together.</p> * * <p>Therefore, you should not use this method if your app uses a {@link PeerGroup}. It is called for you.</p> * * <p>If the remote peer doesn't support Bloom filtering, then this call is ignored. Once set you presently cannot * unset a filter, though the underlying p2p protocol does support it.</p> */ public void setBloomFilter(BloomFilter filter, boolean andQueryMemPool) { checkNotNull(filter, "Clearing filters is not currently supported"); final VersionMessage ver = vPeerVersionMessage; if (ver == null || !ver.isBloomFilteringSupported()) return; vBloomFilter = filter; log.debug("{}: Sending Bloom filter{}", this, andQueryMemPool ? " and querying mempool" : ""); sendMessage(filter); if (andQueryMemPool) sendMessage(new MemoryPoolMessage()); maybeRestartChainDownload(); }
/** * <p>Sets a Bloom filter on this connection. This will cause the given {@link BloomFilter} object to be sent to the * remote peer and if requested, a {@link MemoryPoolMessage} is sent as well to trigger downloading of any * pending transactions that may be relevant.</p> * * <p>The Peer does not automatically request filters from any wallets added using {@link Peer#addWallet(Wallet)}. * This is to allow callers to avoid redundantly recalculating the same filter repeatedly when using multiple peers * and multiple wallets together.</p> * * <p>Therefore, you should not use this method if your app uses a {@link PeerGroup}. It is called for you.</p> * * <p>If the remote peer doesn't support Bloom filtering, then this call is ignored. Once set you presently cannot * unset a filter, though the underlying p2p protocol does support it.</p> */ public void setBloomFilter(BloomFilter filter, boolean andQueryMemPool) { checkNotNull(filter, "Clearing filters is not currently supported"); final VersionMessage ver = vPeerVersionMessage; if (ver == null || !ver.isBloomFilteringSupported()) return; vBloomFilter = filter; log.debug("{}: Sending Bloom filter{}", this, andQueryMemPool ? " and querying mempool" : ""); sendMessage(filter); if (andQueryMemPool) sendMessage(new MemoryPoolMessage()); maybeRestartChainDownload(); }
private void stepThroughInit(VersionMessage versionMessage, InboundMessageQueuer writeTarget) throws InterruptedException { checkState(writeTarget.nextMessageBlocking() instanceof VersionMessage); checkState(writeTarget.nextMessageBlocking() instanceof VersionAck); if (versionMessage.isBloomFilteringSupported()) { checkState(writeTarget.nextMessageBlocking() instanceof BloomFilter); checkState(writeTarget.nextMessageBlocking() instanceof MemoryPoolMessage); } } }
if (vPeerVersionMessage.isBloomFilteringSupported() && useFilteredBlocks) { getdata.addFilteredBlock(item.hash); pingAfterGetData = true;
if (vPeerVersionMessage.isBloomFilteringSupported() && useFilteredBlocks) { getdata.addFilteredBlock(item.hash); pingAfterGetData = true;
if (vPeerVersionMessage.isBloomFilteringSupported() && useFilteredBlocks) { getdata.addFilteredBlock(item.hash); pingAfterGetData = true;
if (vPeerVersionMessage.isBloomFilteringSupported() && useFilteredBlocks) { getdata.addFilteredBlock(item.hash); pingAfterGetData = true;