diff options
author | Sonic <sonic@dexon.org> | 2019-04-19 12:32:53 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-19 12:32:53 +0800 |
commit | 6c00e42f8dfec9e5d0ef8582a0ed8d809b631564 (patch) | |
tree | 2c0476aa0d4679ea5094a27d4b8ba07415584aaa /dex | |
parent | 31d2950d993b00d743fb61c887752d25adfd6703 (diff) | |
download | dexon-6c00e42f8dfec9e5d0ef8582a0ed8d809b631564.tar.gz dexon-6c00e42f8dfec9e5d0ef8582a0ed8d809b631564.tar.zst dexon-6c00e42f8dfec9e5d0ef8582a0ed8d809b631564.zip |
dex/downloader: fix find common ancestor (#376)
Diffstat (limited to 'dex')
-rw-r--r-- | dex/downloader/downloader.go | 4 |
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 } |