3
0
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:
Miron Cuperman (devrandom) 2011-10-28 18:46:43 +00:00
parent 415f8e611c
commit a88bb0bc1c
2 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -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());