mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-01-31 07:12:17 +00:00
Notify even if nothing to download, resolves issue 90
This commit is contained in:
parent
415f8e611c
commit
a88bb0bc1c
@ -40,6 +40,10 @@ public class DownloadListener extends AbstractPeerEventListener {
|
||||
public void onChainDownloadStarted(Peer peer, int blocksLeft) {
|
||||
startDownload(blocksLeft);
|
||||
originalBlocksLeft = blocksLeft;
|
||||
if (blocksLeft == 0) {
|
||||
doneDownload();
|
||||
done.release();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -412,7 +412,7 @@ public class Peer {
|
||||
setDownloadData(true);
|
||||
// TODO: peer might still have blocks that we don't have, and even have a heavier
|
||||
// chain even if the chain block count is lower.
|
||||
if (getPeerBlocksToGet() > 0) {
|
||||
if (getPeerBlocksToGet() >= 0) {
|
||||
for (PeerEventListener listener : eventListeners) {
|
||||
synchronized (listener) {
|
||||
listener.onChainDownloadStarted(this, getPeerBlocksToGet());
|
||||
|
Loading…
Reference in New Issue
Block a user