aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSonic <sonic@dexon.org>2019-04-19 12:32:53 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-20 13:46:12 +0800
commit12936254a5c54f788ba8963abb54da2e350d5f55 (patch)
treee673f79f0d04e44e6eaedb418ab9a03699fe692a
parente7fb98f71cdc141ab18232a0f3b76932c0c9d40d (diff)
downloaddexon-12936254a5c54f788ba8963abb54da2e350d5f55.tar.gz
dexon-12936254a5c54f788ba8963abb54da2e350d5f55.tar.zst
dexon-12936254a5c54f788ba8963abb54da2e350d5f55.zip
dex/downloader: fix find common ancestor (#376)
-rw-r--r--dex/downloader/downloader.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/dex/downloader/downloader.go b/dex/downloader/downloader.go
index 9d609584b..0847cd062 100644
--- a/dex/downloader/downloader.go
+++ b/dex/downloader/downloader.go
@@ -848,7 +848,7 @@ func (d *Downloader) findAncestor(p *peerConnection, remoteHeader *types.Header)
default:
known = d.lightchain.HasHeader(h, n)
}
- if known {
+ if n <= localHeight && known {
number, hash = n, h
break
}
@@ -919,7 +919,7 @@ func (d *Downloader) findAncestor(p *peerConnection, remoteHeader *types.Header)
default:
known = d.lightchain.HasHeader(h, n)
}
- if !known {
+ if !known || n > localHeight {
end = check
break
}