mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-12 10:15:52 +00:00
PeerGroup: configure peer as download peer even when there is no chain, but don't configure download params as that would trigger block fetch.
This commit is contained in:
parent
8f219ff458
commit
f82f160c2c
@ -1251,7 +1251,6 @@ public class PeerGroup implements TransactionBroadcaster {
|
|||||||
// aren't relevant to our wallet. We may still receive some false positives, which is
|
// aren't relevant to our wallet. We may still receive some false positives, which is
|
||||||
// OK because it helps improve wallet privacy. Old nodes will just ignore the message.
|
// OK because it helps improve wallet privacy. Old nodes will just ignore the message.
|
||||||
if (bloomFilterMerger.getLastFilter() != null) peer.setBloomFilter(bloomFilterMerger.getLastFilter());
|
if (bloomFilterMerger.getLastFilter() != null) peer.setBloomFilter(bloomFilterMerger.getLastFilter());
|
||||||
// Link the peer to the memory pool so broadcast transactions have their confidence levels updated.
|
|
||||||
peer.setDownloadData(false);
|
peer.setDownloadData(false);
|
||||||
// TODO: The peer should calculate the fast catchup time from the added wallets here.
|
// TODO: The peer should calculate the fast catchup time from the added wallets here.
|
||||||
for (Wallet wallet : wallets)
|
for (Wallet wallet : wallets)
|
||||||
@ -1320,15 +1319,8 @@ public class PeerGroup implements TransactionBroadcaster {
|
|||||||
private void setDownloadPeer(@Nullable Peer peer) {
|
private void setDownloadPeer(@Nullable Peer peer) {
|
||||||
lock.lock();
|
lock.lock();
|
||||||
try {
|
try {
|
||||||
if (downloadPeer == peer) {
|
if (downloadPeer == peer)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
if (chain == null) {
|
|
||||||
// PeerGroup creator did not want us to download any data. We still track the download peer for
|
|
||||||
// informational purposes.
|
|
||||||
downloadPeer = peer;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (downloadPeer != null) {
|
if (downloadPeer != null) {
|
||||||
log.info("Unsetting download peer: {}", downloadPeer);
|
log.info("Unsetting download peer: {}", downloadPeer);
|
||||||
if (downloadListener != null)
|
if (downloadListener != null)
|
||||||
@ -1341,7 +1333,8 @@ public class PeerGroup implements TransactionBroadcaster {
|
|||||||
if (downloadListener != null)
|
if (downloadListener != null)
|
||||||
peer.addEventListener(downloadListener, Threading.SAME_THREAD);
|
peer.addEventListener(downloadListener, Threading.SAME_THREAD);
|
||||||
downloadPeer.setDownloadData(true);
|
downloadPeer.setDownloadData(true);
|
||||||
downloadPeer.setDownloadParameters(fastCatchupTimeSecs, bloomFilterMerger.getLastFilter() != null);
|
if (chain != null)
|
||||||
|
downloadPeer.setDownloadParameters(fastCatchupTimeSecs, bloomFilterMerger.getLastFilter() != null);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
|
@ -36,6 +36,7 @@ public class WatchMempool {
|
|||||||
@Override
|
@Override
|
||||||
public void onTransaction(Peer peer, Transaction tx) {
|
public void onTransaction(Peer peer, Transaction tx) {
|
||||||
try {
|
try {
|
||||||
|
log.info("tx {}", tx.getHash());
|
||||||
if (tx.getOutputs().size() != 1) return;
|
if (tx.getOutputs().size() != 1) return;
|
||||||
if (!tx.getOutput(0).getScriptPubKey().isSentToRawPubKey()) return;
|
if (!tx.getOutput(0).getScriptPubKey().isSentToRawPubKey()) return;
|
||||||
log.info("Saw raw pay to pubkey {}", tx);
|
log.info("Saw raw pay to pubkey {}", tx);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user