From d1c3be126d41aa3613190fb3e185a00d21d64262 Mon Sep 17 00:00:00 2001 From: Oscar Guindzberg Date: Wed, 25 Jun 2014 11:20:07 -0300 Subject: [PATCH] PeerGroup.startBlockChainDownload(): add the supplied listener to the downloadingPeer --- core/src/main/java/com/google/bitcoin/core/PeerGroup.java | 2 ++ 1 file changed, 2 insertions(+) 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 27a39568..cd4d5573 100644 --- a/core/src/main/java/com/google/bitcoin/core/PeerGroup.java +++ b/core/src/main/java/com/google/bitcoin/core/PeerGroup.java @@ -1004,6 +1004,8 @@ public class PeerGroup extends AbstractExecutionThreadService implements Transac try { if (downloadPeer != null && this.downloadListener != null) downloadPeer.removeEventListener(this.downloadListener); + if (downloadPeer != null && listener != null) + downloadPeer.addEventListener(listener); this.downloadListener = listener; // TODO: be more nuanced about which peer to download from. We can also try // downloading from multiple peers and handle the case when a new peer comes along